Please point us in right direction
We have a requirement to
Generate a PDF
Edit/Enter some fields on it
Save/Print the information
Should have a button on the pdf "Convert to TIFF" that should generate TIFF image of that PDF
I am sure we can do 1 and 2 very easily, we are planning to use iText API.
We dont have any clue about 4.
Experts if you have any idea please let us know.
We are using Java
There are lots of programs which do PDF to image conversion (both Open Source and Commercial). You can also use icepdf, Jpedal, Qoppa and PDFRenderer
You can create, edit and fill PDF form fields using Gnostice PDFOne. PDFOne can also print PDF documents and forms. Existing documents can also export PDF pages to image formats. For exporting to TIFF, you will also need for Advaned Imaging IO library from Oracle (Sun). Disclaimer: I work for this company.
If you want a button on the PDF to export the document to TIFF, then that is not possible, as PDF specification does not describe such a feature. As mentioned earlier, any PDF document can be converted to image formats including TIFF.
DISCLAIMER: I work for Gnostice.
Related
I am using iText to generate PDF and is working fine, and I can also download it via browser as PDF. However, is it possible for java or iText to convert it to JPEG or any IMAGE file and allow users to download the image file.
response.setContentType("application/pdf; charset=utf-8");
Merely changing the contentType to image/jpg is not possible. I am continuously looking for answer but struggling to find one.
Any idea would be a lot of help
I dont know more about iText. But using PDFBox we can convert pdf document into images.
After splitting you can push images to response.
Here some reference links :
http://pdfbox.apache.org/commandlineutilities/PDFToImage.html
Converting a PDF into multiple JPGs with iText or other
http://www.javatpoint.com/example-to-display-image-using-servlet
you can use iText only for generating a pdf nothing else. see the link http://itextpdf.com/itext.php . see this to convert a pdf to image. See this link as well for clearer understanding with an example.
I would like to have a preview of a .pdf, .docx or .doc file inside a JDialog. But I'm unable to find previewers that allow nesting of such previews inside a Swing application. Alternatively are there any previewers that can transform such files into .html and then display them in a TextPane.
Fidelity isn't that much of an issue as is embedding and ease of use. Also I don't require one tool to be able to preview all types of files.
That's a tough one because of the formats you're dealing with. You might want to try ImageMagik for PDF -> image format for display in your TextPane. If that works well enough for PDFs, then you could use JOD Converter or Docmosis to get from Doc -> PDF then ImageMagick again for a display image. JODConverter and Docmosis are based on OpenOffice which can do pretty rough html / xhtml output as another option for display. The latest version of OpenOffice can read docx also, meaning all your bases are covered, and if fidelity is not too big a deal as you've indciated, then JODConverter/Docmosis and ImageMagick might be a combo you can use.
I want to generate PDF file from RTF file.
I have tried following.
Itext
It's already outdated and new version doesn't support rtf.
JDocConverter
It uses OpenOffice on the background. it is working fine, there is only one problem. Open office doesn't support drawing object in RTF.
Any other possible and reliable solutions?
Note: It would be fine don't use any commercial software.
Windows has native convert RTF to PDF using command line, however it will to a degree be limited, so it will use direct convert text and images, but it will depend on rtf syntax as to which drawn objects are supported. WORD ART drawing objects need MS Word to print
The output looks reasonable but here is the source in MSWord where the art was clearly not handled by the non-word printout.
Under Windows you could print to CutePDF Writer. This freeware uses Ghostscript as a back end.
You may try Aspose.Words for Java to convert RTF file to PDF format. You can load a file in RTF format into Aspose.Words for Java and then save it to PDF format. Please note that while loading specify RTF as LoadFormat value and pass PDF as SaveFormat value while saving the document. This doesn't require OpenOffice or any other software to be installed for the conversion to work.
Disclosure: I work as developer evangelist at Aspose.
Best way to do it is use MS Office. And Ms Office is able to save file in PDF format (you need install some addons I think).
I am developing a standalone application in Java. I want to generate a pdf file using Java code. I have a display form in which all the details are fetched from database and displayed in the window. Details are Customer Name, Order Details etc.
Now I want to have a button there which says Convert to pdf.
I want to convert this to pdf file with proper alignment and formatting like tables, font etc.
What can be an ideal way to go about it?
I'd suggest you to use reporting tool like a jasperreports.
JasperReports is entirely written in
Java and it is able to use data coming
from any kind of data source and
produce pixel-perfect documents that
can be viewed, printed or exported in
a variety of document formats
including HTML, PDF, Excel, OpenOffice
and Word.
Have a look at other open source projects (pdf api):
Apache PDFBox
Apache Tika (Toolkit for detecting and extracting metadata and structured text content from various documents using POI and PDFBOX parser libs.)
PDFjet
Use iText:
http://itextpdf.com/
I was looking at using iText to create both a pdf and html version of a document with RTF as a possible option. According to this question this is no longer possible with iText. Is there a library that will allow me to create a document in Java and output it as both PDF and HTML? The ability to output RTF would be nice but is not required.
As that answer to the other question states, you can just use the iText RTF Library.
I have used PD4ML to convert HTML to pdf. Even though it is a commercial app. It is very reliable and supports CSS well.
JasperReports. If you look at this package it supports export to:
pdf
html
rtf
xls
xml
You have two options to create the documents:
via iReport - a visual designer for reports
via an API, where you construct everything with Java code.
Note that even though JasperReports's main function is to create reports, it can very well create other documents, with no tabular data for example.
You could also try Docmosis since that supports the output formats provided by OpenOffice (including the ones you specified) and you can often do the job with a lot less code.