You are not logged in.
Pages: 1
hi!, can it be possible to read PDF files and extract a page to TBitmap ?
Offline
Our engine is a PDF writer, you're not able (yet) to read pdf files.
It could be possible to read PDF files in our unit, because we've flattered the whole pdf format into Delphi classes.
But a dedicated parser is needed.
If you want to export a PDF into a bitmap, you should need not only a PDF parser/reader, but a PDF renderer.
There are some solutions around, the most easy I could guess is to install a virtual printer able to print into files (PDF creator allows this, AFAIR), then print the PDF page from your PDF renderer (like Acrobar Reader), and get the resulting file.
You could try to use the ActiveX version of Acrobar Reader, then use screenshots to get the result. But the resolution won't be good, it'll be limited by the actual monitor resolution. Not a good solution.
Offline
If you want just to extract an image stored inside a pdf, you could try the free pdfimage command line tool.
You can get it freely from http://www.foolabs.com/xpdf
Other tools do exist around, but they are not free.
Offline
hi again and thanks for replies
yes what I am looking for is some renderer, I would like to view the PDF file, and be able to use it as a normal TBitmap/TGraphic etc etc, and be able to assigned to an TImage.
the ActiveX method I tried, but it seems not to be able to screenshot it, or export it as a image, even foxit reader does not help me here
Offline
You can try this one:
http://www.wpcubed.com/products/pdfviewer/index.htm
It does exactly what you need.
But it cost some money.
Offline
if it cost a few bucks, that is ok
thanks
Offline
hmm how many bucks?
company I work for have wPDF.. shame they did not have the viewpdf hmmm
Offline
ah expensive, but if it is the only component out there, i guess there is not much other alternatives..
i checked image magic, but convert.exe crashes everytime i do
convert 1.pdf 1.png
Offline
Checkout SumatraPdf and XPDF.
Perhaps there is some command line options for rendering a page content into a png.
Or you could ask the author for such a feature (SumatraPdf is made by one man, so you could have a chance here).
Offline
thanks ab!
can you please add a feature at this forum, notifying the registered email if there are any new messages in a thread ?
I tend to forget where I write on message boards sometimes
Offline
Did you make a try to http://mupdf.com ?
MuPDF is a lightweight PDF viewer and toolkit written in portable C.
The renderer in MuPDF is tailored for high quality anti-aliased graphics. It renders text with metrics and spacing accurate to within fractions of a pixel for the highest fidelity in reproducing the look of a printed page on screen.
MuPDF has a small footprint. A binary that includes the standard Roman fonts is only one megabyte. A build with full CJK support (including an Asian font) is approximately five megabytes.
MuPDF has support for all non-interactive PDF 1.7 features, and the toolkit provides a simple API for accessing the internal structures of the PDF document. Example code for navigating interactive links and bookmarks, encrypting PDF files, extracting fonts, images, and searchable text, and rendering pages to image files is provided.
License
MuPDF is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Offline
mupdf, never heard of, but C, I cannot use:(
Offline
You can try to compile it into a dll, then call it from Delphi.
The API seems not difficult to convert and Delphi external functions.
And there is dedicated calls for converting a PDF into pictures, just as you expect.
Offline
Pages: 1