pdf to tiff

Convert PDF to TIFF using .NET REST API.

In today’s digital landscape, efficient document management is essential for businesses and individuals alike. One common need that often arises is the conversion of PDF files to TIFF images. Whether it’s for archiving, printing, or compatibility purposes, having the capability to seamlessly convert PDF documents to high-quality TIFF images can significantly enhance document workflows. In this article, you will learn the steps to streamline your document processing, improve accessibility, and enhance the versatility of your data by converting PDF to TIFF using .NET REST API.

PDF to TIFF Conversion using REST API

When it comes to converting PDF files to TIFF images, Aspose.PDF Cloud SDK for .NET stands as a robust solution. This versatile SDK offers a comprehensive set of tools to handle various aspects of PDF manipulation. Not only can you effortlessly convert PDFs to TIFF images, but you can also tap into a wide array of other features including text extraction, image extraction, merging PDFs, and much more.

The first step in the utilization of SDK is its installation on local system. Simply search Aspose.PDF-Cloud in NuGet packages manager and click the Add Package button. Furthermore, please visit cloud dashboard and obtain your personalized client credentials.

Convert PDF to TIFF in C# .NET

Let’s explore further details on how we can programmatically convert PDF files to TIFF images using C# .NET. You get the flexibility to specify the dpi information for resultant image i.e. PDF to TIFF at 600 dpi, convert PDF to TIFF at 300 dpi etc.

pdf to tiff online

Preview of PDF to TIFF Conversion.

Now, let’s explore some details of above stated code snippet.

PdfApi pdfApi = new PdfApi(clientSecret, clientID);

Firstly, create an instance of PdfApi class where we pass client credentials as arguments.

String inputFile = "Binder1-1.pdf";
var sourceFile = System.IO.File.OpenRead(inputFile);

Load the content of input PDF file to stream instance.

var compressionFactor = "None";

Specify the compression factor for resultant TIFF. Possible values can be LZW, CCITT4, CCITT3, RLE, None.

var colorDepthValue = "Default";

Specify the color depth information for resultant TIFF. Possible values can be Default, Format8bpp, Format4bpp, Format1bpp.

pdfApi.PutPdfInRequestToTiff(resultantFile, brightness, compression: compressionFactor, 
    colorDepth: colorDepthValue, leftMargin, rightMaring, 
    topMargin, bottomMaring, Orientation, skipBlankPages, 
    pageInexForConversion, numberOfPages, file: sourceFile);

Call the API to convert PDF to TIFF and save the output in cloud storage.

PDF to TIFF Online using cURL Commands

If you’re seeking a command-line-oriented approach for converting PDF to TIFF, you can utilize cURL commands in conjunction with Aspose.PDF Cloud. This combination provides a flexible way to achieve your conversion needs. By crafting cURL commands, you can interact with the Aspose.PDF Cloud API and initiate PDF to TIFF conversion seamlessly. This method offers automation and integration possibilities, allowing you to incorporate the conversion process into your existing workflows or scripts.

The first step in this approach is to generate a JWT access token by executing the following command.

curl -v "https://api.aspose.cloud/connect/token" \
 -X POST \
 -d "grant_type=client_credentials&client_id=bb959721-5780-4be6-be35-ff5c3a6aa4a2&client_secret=4d84d5f6584160cbd91dba1fe145db14" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Accept: application/json"

Now we need to execute the following command to convert 3 PDF pages starting from index 3 and save the resultant TIFF to local drive.

curl -v "https://api.aspose.cloud/v3.0/pdf/{inputPDF}/convert/tiff?brightness=100&compression=None&colorDepth=Default&orientation=Portrait&skipBlankPages=false&pageIndex=3&pageCount=3" \
-X GET \
-H  "accept: multipart/form-data" \
-H  "authorization: Bearer {accessToken}" \
-o "resultantImage.tiff"

Replace inputPDF with the name of the PDF file available in cloud storage, and accessToken with JWT token generated above.

Conclusion

In conclusion, both the Aspose.PDF Cloud SDK for .NET and the cURL command approach offer efficient and reliable solutions for extracting text from PDF documents. The Aspose.PDF Cloud SDK for .NET provides a comprehensive and developer-friendly API with a wide range of features, making it a powerful choice for integrating PDF text extraction into .NET applications. On the other hand, the cURL command approach offers a flexible and platform-independent method to interact with the Aspose.PDF Cloud API, making it an excellent option for developers working in different environments and programming languages.

We highly recommend visiting the following blogs: