1

Below features are the key features that we are expecting to achieve from a PDF library:

  • Best Compression(Which can handle for all type of PDF's)
  • Cropping
  • Splitting
  • stitching

Below are the libraries those I tried so far:

  • ILovePDF - PHP (All the compressions related features are working fine, Support is a concern point, We need still higher level of compression, Detail documentation is missing).
  • hummus - NodeJS (Compression was not working as expected, it's spoiling the PDF fonts/content)

Please suggest any other (best in industry) PDF processing libraries with above mention features. I'm fine with any paid libraries too.

Any help is appreciable...

  • By "Best Compression" you mean smallest size? or best quality to size? PDF format supports a number of advanced compression algortithms, where the best choice depends on if the image is mono/gray/color. Why is cropping/splitting/stitching important for you? Why is compression important for you? – Ryan Oct 4 '17 at 18:44
  • Thanks @Ryan, Actually we're planing to give three types of compressions: 1. Smallest size 2. Smaller size but Best quality too 3. Best quality Note: It's fine for us If we've to use different libraries for different options. Splitting and Stitching is important because we are passing those pdf to Mobile platform as 1-1 page at a time and on the other side for the Web end we've to give a complete PDF to browser. Now the point is third party PDF provider can provide the PDF either in the whole PDF at once or in the Separate page files. We've to do either of spit/merge for all pdfs. – Raj Tomar Oct 5 '17 at 5:17
  • Thank you for the clarifications about optimizing. "Splitting and Stitching is important because we are passing those pdf to Mobile platform as 1-1 page at a time and on the other side for the Web end we've to give a complete PDF to browser". Is the viewer on mobile native, or in the browser? Why is supplying the PDF 1 page at a time important? There are ways to view very large PDF files (e.g. school text book) just fine on mobile (native and browser). – Ryan Oct 5 '17 at 17:46
  • Thanks @Ryan, Users are on the Native mobile Applications both IOS/Android and not using Browser, but they can visit mobile site as well, but that is not our concern so far, May in future. 1-1 Page PDF is needed so that user should not wait for the entire file to download and the see. As soon as one Page is downloaded he should see. We can't let user wait for complete big file. I hope above requirement can clarify your doubt. – Raj Tomar Oct 6 '17 at 8:28
1

PDFTron actually has a couple of options for you. Server side, mobile native, and HTML5.

PDFNet SDK for Linux/Android/iOS can optimize, split, crop, stitch.

For optimizing specifically, there is an Optimizer class, which you can configure in different ways to minimize file size. https://www.pdftron.com/pdfnet/samplecode/OptimizerTest.sphp.html https://groups.google.com/d/msg/pdfnet-sdk/rx3j4aYed_A/pUhdwwcLAAAJ

For split, crop, stitch see following code samples. https://www.pdftron.com/pdfnet/samplecode/ImpositionTest.sphp.html https://www.pdftron.com/pdfnet/samplecode/PDFPageTest.sphp.html

However, if your objective is to simply view a PDF file on mobile, either natively or in the browser, then this is possible with no need to split the documents up.

Using PDFNet SDK for Android/iOS you can call PDFViewCtrl.openUrlAsync and simply pass in the URL to the PDF. If the following conditions are meant, than the viewing/interacting will be almost instantaneous.

  1. PDF is saved as linearized (Fast Web View)
  2. Server hosting PDF file supports byte range request headers.

You can use a PDF SDK, like PDFNet, to ensure the PDF files on your server are linearized (fast web view).

We have a free showcase app, called Xodo, which is powered by PDFNet, and available in all the mobile stores, which you can install and evaluate.

The other option, and this will work with both native and web on mobile, is PDFTron's WebViewer solution. WebViewer is a pure HTML5 document viewer. You will need to convert the PDF file to a web optimized format on your server, but once done, and assuming the server hosting the PDF file accepts byte range request headers, than WebViewer will display pages almost instantly, but also never fully downloads the entire document. This means that even on an iPhone or Android phone, your users can view a 1GB PDF containing hundreds of pages, and they can jump to any page to view immediately (random access).

Please see this presentation to learn more about WebViewer. https://prezi.com/view/Aug5ft1twZNNKfBXfTIQ/

If you would like to try our native mobile SDK, including pre-built APK demos, fill in this form. https://www.pdftron.com/pdfnet/mobile/request_trial.html

If you are interested in the server side PDFNet SDK you can download here. https://www.pdftron.com/pdfnet/downloads.html

If you are interested in learning more, please feel free to contact sales or support at PDFTron.

  • Thanks @Ryan, Thanks for your valuable response, I'm really sorry but Actually I forgot to mention one more important reason that requires splitting a PDF into separated pages and that is, Placing an Ads in every single page. So, if we directly show that PDF, we can't place the Ads. – Raj Tomar Oct 9 '17 at 6:41
  • Why do the pages have to be split to place ads on every page? It is straight forward to overlay videos/content over top of the pages. Either floating or even fixed to the page. Perhaps you could elaborate on what you mean exactly by "placing ads in every single page". – Ryan Oct 10 '17 at 16:30
0

I would suggest PDFsam and some of its add-on components.

PDFsam stands for PDF split and merge.

The basic package is free and there are enhanced versions to do some of things you request. The enhanced versions are not free and price is based on level of enhancement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.