Converting PDF to TIF images

I have a number of PDF files that I want to convert to TIF images (one TIF file for each page).


Looking at the examples, the preferred approach appears to use PDFConvertor, however this generates a multi-page TIFF.

An alternate solution that I have seen is to iterate over each page of the document calling TiffDevice.process. Due to the time taken to convert documents to TIF images, I wanted to process each page in parallel, and wanted to know whether the libraries are thread safe. Specifically, Document and TiffDevice.

I plan on using Java 8 with parallelStream to convert the pages in parallel.

Thanks

- viraf

Hi Viraf,

Thanks for contacting support.

Aspose.Pdf is thread safe provided a single document is not accessed by same thread.

However in order to fulfill you requirement, you may iterate through individual page of PDF document or Split PDF File into Individual Pages and then perform conversion.

Sorry, I dont understand your response. If thread safe, I should be able to render pages of a document in multiple threads.


For each PDF file, the code loads the Document, allocates a TiffDevice in a single thread, and then calls Device.process for each page in a thread pool. There does appear to be some synchronization within Aspose as I dont see the CPU over 60% while processing the pages in parallel.

Please clarify your response.

Thanks

- viraf



Hi Viraf,


Thanks for sharing the details.

The idea is to split PDF file into single page documents and then perform the conversion in multi-thread approach where each thread will manipulate specific document. I am working on creating the code snippet and will share it shortly.