Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2105

Support for multipage TIFFs in CCITTFactory, makes PDFBox capable of doing tiff2pdf

    Details

      Description

      I created a patch based on Sergey Ushakov's work that handles multipage TIFFs. This allows fast and efficient conversion from TIFF to PDF

      The general approach is to provide a new factory method that accepts an image (page) number, and then appropriate page number is located when the CCITT stream is being extracted.

      There's a minor inefficiency in this approach because the seek starts from the beginning for each page, causing O(N^2) algorithm when extracting every page, but maximum size for file appears to be 2 GB and the cost for finding a single page will still be low, so I bet this will never come up in practice.

      There is no method that tells how many pages TIFF files have. I opted to simply return null from the factory method that accepts page number if there is no such page, so users can use this as condition to break from a TIFF to PDF conversion loop.

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              alankila@bel.fi Antti Lankila
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified