what is the easiest method to convert a PDF into a TBitmap image in delphi?
if there are any commercial available tools for delphi, I can buy one if it is reliable and or not expensive...
I am thinking of some kind of viewer which I can browse pages.. zoom... and export in the desired resolution..
I have had good results with QuickPDF. It's relatively inexpensive and there is a trial version available.
You could try using the ghostscript api from delphi (see http://ftp.uasw.edu/pub/ghostscript/contrib/ for delphi example files) to convert to a bitmap.
Though I've not used it (was just aware of its existence) I would expect you should be able to put the data into a memory stream and read it from there.
Though, if your software is going to be non-open source it could be an issue .
Related
So I am looking for a solution to read a QR code from delphi with a webcam.
I found this example project to capture the webcam's image and save it to a .bmp file : linky
So I have the image that I want to scan. Now I would like to know how to get its contents in string format in Delphi. So to read the QR code I found ZBar which is exactly what I need. I just cant figure out how to use it with delphi.
I want to know if there is a way I can either implement the libraries ZBar supplies or somehow run ZBar and just receive the decoded text ?
ZBar has a command prompt example so I thought that it would be possible to run the command prompt, receive the results and just format the strings to find the code (like this). But that seems rather hacky and I am sure there must be a better way. I also could not get any of the answers to work.
I am using delphi 7 or xe3 if thats a factor.
Thanks for your time and suggestions.
The famous ZXing library finally has been ported to Delphi, but it is for the modern Delphi versions like Delphi 10.4, because there are new features used like in-place filling of dynamic arrays. I tried to rewrite it for Delphi 6 and didn't manage that.
Here is the link: https://github.com/Spelt/ZXing.Delphi
There is also an example for a webcam.
There are two systems. I need to get the document in some format and print it in my application.
The source file should be in a pdf format.
Do you know the component for delphi7 that i could be able to open pdf file and print it on delphi's canvas. Is such approach good for the pdf document quality?
Or which format of the source document could be better to print in delphi application?
Thanks
I think almost all PDF preview components may do it.
When searching - https://www.google.ru/search?client=opera&q=delphi+render+pdf+to+canvas&sourceid=opera - you would instantly get at least few commercial libs:
http://www.gnostice.com/nl_article.asp?id=229&t=Convert_PDF_To_High-Resolution_Images_Using_Delphi
http://www.quickpdflibrary.com/faq/can-i-use-quick-pdf-as-a-viewer-in-my-delphi-application.php
http://www.wpcubed.com/manuals/wpviewpdf/idh_twpviewpdf_printhdc.htm
TCanvas is a wapper around Windows HDC. See http://docwiki.embarcadero.com/Libraries/en/Vcl.Graphics.TCanvas.Handle
I have imported Acrobat Reader using Components | Import Components. The AcroPdf_TLB unit is created in the Imports directory.
When I try to use the AcrobatReader component, as follows ...
AcroDoc := TAcroPDF.Create(nil);
... I get an 'Unspecified Error' exception (EOleSysError). Any ideas?
Thanks, Pieter.
If you are unhappy with the results you are getting there (I was), you might consider giving QuickPDF a try. The price is not unreasonable, they have lots of good PDF functions included and you can display a PDF accurately in a TImage control with a call to RenderPageToStream. One thing I discovered working with form fields is that I had to use their FlattenFormField before rendering to get the form field contents to be included in the rendered image.
Follow up:
I did not mention originally that QuickPDF also works for printing. For form fields, you have to do the same FlattenFormField routine, but the results look good with much less overhead than relying on Acrobat Reader.
We use the Adobe Reader plug-in and face this issue often. It particularly surfaces after a user performs a web-update on the Adobe Reader.
Try un-installing (via the Control Panel), then re-installing the latest Adobe Reader.
That invariably clears the issue for our users.
Put the component on a TForm, then it probably works.
The Acrobat ActiveX/COM object is notorious for not supporting interfaces of older versions properly. You get EOleSysErrors all over the place.
What I have personally done for a couple of clients, is load the PDF documents in a TWebBrowser.
TWebBrowser is a wrapper around the ActiveX/COM component that Internet explorer uses to display everything.
Adobe is pretty good in making that work with each Acrobat update, so the TWebBrowser then also works.
Note that this only makes sense for displaying the PDF document.
--jeroen
We successfully used the acrobat v6 reader component in our Delphi 7 app, but found that it really requires acrobat v6. Users today who install only acrobat v9 get an error when they use our app to view a pdf because the acrobat component is not backward compatible in this way.
So yes, you can do it, but there are probable issues going forward.
A third party tool is prob best...
I have 4 small tiff images and I would like to generate a big one by merging the 4 single one. Does anyone know how to do it directly with Delphi or some good component that could do it?
You could use GraphicEx by Mike Lischke to load the Tiff images:
http://www.soft-gems.net/index.php?option=com_content&task=view&id=13&Itemid=33
ImageMagick is a command line application that can do such kind of operations on different image file formats including tiff.
The API seems to be usable from Delphi, see PascalMagick.
Another excellent graphics library for Delphi is Graphics32
Edit: As Vegar said, it looks that Graphics32 cannot be used to load TIFF format.
Another library you can use is FreeImage. It supports loading and writing of TIFF files. Beware: the Delphi wrapper is not actively maintained, but it works. We use it in our software to display previews of images.
ImageEn one of the best Image libraries for Delphi, and it's native VCL ;-)
Im a newbie programmer in Delphi. I need help, I have a small project which I need to display all kind of image format.
Please suggest what should I do or any component in delphi that support all image format? thanks for the help in advance.
Have a look at the GraphicEx library available from www.soft-gems.net. This should give you most (if not all) of the formats you want.
I found a Library that suites my need. It called vampyre library and works amazing. It support TIFF,tif, animating gif and many more
You can use several image types with the standard TImage component. At least bmp and jpg (if you use the Jpeg unit).
Version 2009 added some more. Image formats (I thought at least png and wmf).
There are a lot of third party components for image display/processing. A google search will show them all.
GraphicEx should be a good start. It's free and contains the most used formats.
Both ImageEn and Imaging Toolkit for Delphi offer wide range of supported format
and you can find more in torry site