With iText 5, how to save a PDF file as linearized PDF - java

With iText 5 (java), is it possible to save a PDF file as a linearized PDF, also called sometimes “Web Optimized” or “Fast Web View” enabled PDF ?

iText 5 does not have a feature for saving linearized PDFs.
Actually this would not fit the iText 5 architecture at all which attempts to write data to its target output stream as early as possible, and you cannot do that while creating a linearized PDF.
Nonetheless, you can of course create a PdfStamper-like class which takes a PdfReader representing an existing PDF and stores it as a linearized PDF. This will require quite some coding, though.

Related

Display pdf documents in java using iText (and not acrobat reader)?

I can get the the file to open and display in an external reader but it is possible to get it to open within java (eg. in a JPanel)? I am using iText would this be possible or would i need something like ICEPdf?

All inclusive tool to convert different types of documents to pdf

I've been looking around the web for a tool I can use with Java. Whether it be a Java API or a command-line interface I can create a Java wrapper around to give me the ability to convert multiple types of documents to a PDF.
Here is the list of documents I need to be able to convert to PDF:
images (.tiff, .jpeg, .png, .bmp, .gif)
MS WORD (.doc, .docx)
text files (.txt, .rtf)
Here are some notes on what I have found so far around the web related to pdf conversion
JODConverter - http://www.artofsolving.com/opensource/jodconverter
looks to convert a lot of different types of formats to PDF
Is no longer actively developed
FREE
iText will not work - http://itextpdf.com/itext.php/
"iText can convert an XML or an XHTML/CSS file to PDF (using XML Worker). Converting documents from one format to another is outside the scope of iText. And no: iText does not convert Word documents to PDF!"
GhostScript - http://www.ghostscript.com/
Converts postscript to pdf
need to find software which would convert file formats to ps first
maybe not the best solution
FREE
Qoppa Software - http://www.qoppa.com/solutions/javapdf.html
jPDFImages - creates pdfs from jpg, tif and png images
jWordConvert - converts word documents to PDF (doc, docx)
Costs money
imagemagick - http://www.imagemagick.org/script/index.php
converts one image to a pdf at a time
would need to be used with a batch script to combine all pdfs into one
doesn't do anything other than images.
FREE
If any of the information about these products is incorrect, any corrections would be appreciated.
Is there a solution out there which is still actively supported which would do all of these conversions in one piece of software?
I feel like this is a common problem people come across and there has to be a better solution than combining several third party products together. It can be open source or require a license and money.

Converting all document types(MS DOCs+TIFFs+JPGs) stored on Filenet CE to pdf

Currently we are developing a Java application to grab documents (all types can be stored on filenet) from Filenet and displaying it in pdf format, the issue is that I need a tool for converting all MS doc types (doc, docx, ppt, pptx,...) to pdf. I've tried Apache POI and iText but they just convert the Office 2007 formats and it just gets a plain text without any formatting and without images.
Second in image documents I already converted the images to pdf but I need to get the annotations made by IBM applet image viewer printed on the image. How can I get that?
I need to an opensource/free solution, any not-free solution (like Snowbound, adptel) will be rejected by the customer.
Any support will be appreciated
Check out docx4java, http://www.docx4java.org/trac/docx4j
Can handle .docx and .pptx exports and the documentation gives some info on how to handle older .doc files.

Does iText create image-based or text-based PDF files?

I currently use iText for PDF generation and I am having difficulty determining if the PDF files generated with iText are text-based or image-based once generated. Is there an easy way to determine that programmatically (or to specify one option or the other at the time of generation)?
iText generates PDF text instructions for text, and PDF image XObjects for images. Some other elements (e.g. borders) are generated as PDF graphics instructions. So I suppose you could say it generates "text-based" files.

What is the best way to display multiple PDF files via browser?

I'm developing an web application using Flex and JSP.
I am having some performance issues with displaying multiple PDF files.
I am trying to display about 50-100 PDF files. I know that is a little crazy.
Hence, I made the project to convert PDF files to JPG format and display the JPG files.
I'm wondering if there is a way to decrease the file size of PDF to size of JPG.
Additionally, I would like to seek other way that may improve the performance.
Does anyone know a good way to display many PDF files (that will be mostly just text) for web application? Or, should I just have it display JPG files?
If the PDF files are mostly text you should probably use HTML. Is there something that would prevent you from making regular pages from your PDFs?
You can convert the PDF to rtf text file, use the text from rtf file to populate your HTML page perhaps in a table.
Check out ghostscript lib for doing this conversion.

Categories