Java: Embed a HTML or PDF into a JFrame - java

I am open to alternative solutions, so here is my problem.
I have 111 PDFs that contain information on various degree programs. I can convert them to HTML using freeware.
The problem with the HTML is that it contains CSS, JEditorPane doesn't display the webpage, and the PDF libraries are slow and bulky.
I want to have a JCombobox where users can select a page to view, and have it appear below the box.
Any ideas on the best method?

Use iText API for PDF and DJ Project for HTML/webPage.

Most libraries that convert PDF to HTML can also convert PDF to image.
If you can convert to SVG and display it using one of the SVG libraries (E.g. Batik), that would be one way you could display it without losing any functionality like zoom in/out.
Otherwise you can convert PDF to high-res JPG/PNG and display it in your app.

Related

how to print dvt hierarchy viewer in pdf

My requirement is just to show the DVT hierarchyView in a HTML format in PDF, I don't want to embed the flash content in to PDF.
Also, the above links seems suggesting use of FLEX which we are not comfortable of.
Do you have any other pointers please

Extracting all images and text from pdf file

I need to create json from pdf to render the pdf content as HTML with all the images and text. I have tried the modules below to do that. I am able to extract only plain images now, but not able to extract the graphical images and background shadow images. Is there any module to get these?
Modules tried
-PDFMiner (python)
-Mammoth(Node)
-pdf2json(Node)
-PDFBox(Java)
Have a look at http://pythonhosted.org/PyMuPDF/. Apparently this product renders pages in various formats, including json. Although I have limited experience with it, the recipe at http://code.activestate.com/recipes/580703-extract-images-of-a-pdf-optionally-by-page-using-p/history/1/ shows how to use PyMuPDF to extract images from a PDF.

Print with PdfBox, render pdf in browser

I am usieng PDFBox to fill a template with some data and I wish to render it in Chrome, so that I can give the user the possibility to preview it before printing it from the web page.
Does anyone knows if PDFBox supports to render the created PDF in a browser?
Thanks.
PDFbox not directly, since it just creates the pdf. But you can simply include the pdf in your webpage through varying methods, depending on your architecture.
One simple example is:
<embed src="http://example.com/file.pdf" width="500" height="500" type='application/pdf'>
More options have been discussed in this question: Recommended way to embed PDF in HTML?

File previewers for PDF and Docx

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.

Generate Save Convert to TIFF PDF

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.

Categories

Resources