PDF add stamp annotation from image - delphi

I have very specific task in Delphi 2010 with PDF. After some days fight I want to ask your help.
Task:
open pdf in embedded viewer component on a form
define a rectangle with mouse on the document
add into the rectangle stamp annotation from image file (BMP or PNG or JPG). The image must be stretched to the selected rect.
I try to use next components:
Acrobat Reader ActiveX (TAcroPDF)
Gnostice PDF Toolkit
Debenu PDF library
At the moment I have crazy mix of problems.
Acrobat can show PDF and can show annotations but has a methods to select a rectangle and to add a stamp from an image file.
Gnostice can show PDF, can select a rectangle BUT can not add annotation from image file and can not read all new 1.7 PDF files.
Debenu has no viewer but can read all files, can add a stamp fro image file.
Now I have almoust working solution with using all 3 libraries (each for own part of the task).
But some times acrobat library (or any other) raises exception like "can not save file" and other ones. I killed all concurence for processed PDF file (at one moment only one component exists, all other is destroyed).
The main question is not to help to kill the exceptions... But show me a way or library to solve the task. Maybe exist a PDF library for Delphi which I do not know... and this wonderful library can solve the task.
Thanks.

I would suggest not using TAcroPDF all together.
please see this post: TAcroPDF loses resolution after form has resized.
furthermore:
Debenu PDF library can render, modify and save PDF files as an Image - if you simply just have to show the user a preview - using debenu - create a temporary image file and show it in a TImage - Then use the rest of the Library to save the actual .PDF or do whatever you need to.

Related

How to highlight text in pdf using PdfKit

I am creating app where i need to load the pdf file from document directory and need to highlight text manually by user.
Also we need to export the updated pdf file and upload it to the server.
Is there any way to manage the same using pdfkit ?
Please share the sample code if available.
We are using the library as a reference is listed below
https://github.com/uxmstudio/UXMPDFKit
This library is using the same concept as we need but exporting the pdf is the main task we need to achieve.
In simple word we can say that user can highlight some text from the displayed pdf text and upload it to the server.

FastReport - display PDF in report

I try to display a PDF file (stored in the DB as image field) in my report. When I display it in an image object, the image object appears empty.
What am I doing wrong or is there another way to display PDFs in a FastReport report?
I'm using Delphi Embarcadero XE6 and FastReport V5.1.
Use TfrxPictureView and assign it with your database field
If you have already converted all PDFs to JPEG and then stored them as JPEGs in the DB, then TfrxOleView will be able to display them.
If not, you need to create a custom report component derived from TfrxReportComponent and handle its Draw event. The Draw event should get the PDF blob, convert it as a metafile/bitmap, and then draw the metafile/bitmap on the canvas of the custom control. This custom component needs to be used in your report instead of the TfrxPictureView control. (Check FastReport's Developer manual for more information.)
You will need a PDF library to convert the PDFs to metafile/bitmap. (I recommend my company's product PDFtoolkit for this.)
PDF-to-JPEG conversion takes time and may slow down your reports. So, I would advise you to first run the conversion on your DB and store the images in another column. That way, you don't have to write any custom report component. You just refer the images column/field.

How to make a Photoshop (.psd) file have hyperlinks when saved as a .PDF file?

I created a template for a document i want to use, in photoshop.
I want to share this document as a PDF file.
I want some of the text i made in photoshop to work as hyperlinks and direct ppl to websites.
How do i save a photoshop file as a PDF and get hyperlinks to work in the PDF file?
I have tried using the slice tool. It works to assign a url and target.
But when saved as a PDF the links do not work.
Anyone?
I know that indesign allows for saving pdf documents in either print or web format. the latter allows for hyperlinks to be available. if photoshop does not offer this you can always add them in acrobat (not reader) and then resave the .pdf.

Is it possible to display a PDF in a Report Builder report?

We use report builder to generate reports on our software developed with Delphi 2010. I have a lot of reports that display an image, but:
Is it possible to display a PDF in a report builder report just like we display a JPG?
One of our customers wants to display PDFs that contains only a single page with an image (dont ask me why he did not save it as JPG). But the problem is, he has a lot of pdfs that he does not want to convert.
It is possible IF you convert the PDF to another image format.
refer to how to convert PDF to BMP/PNG/JPG etc etc
or check out http://wiki.freepascal.org/PascalMagick

Pdf modification on iOS

I am looking to be able to open a pdf file (done) and then be able to use the touch screen to sign the pdf and then save it with the modification. From what i have read this is no easy task, and i have no idea where to begin. Any of you know any tutorials or frameworks that will help me with this ?
Also if possible being able to modify fields of a pdf file, on the desktop the pdf can have fields you can click on then type in to fill out the form, without the need to ever print. If this is possible as well that would be perfect.
Thanks.
Maybe libHaru (http://libharu.org/wiki/Main_Page) does what you want, it's worth a try.
Does your starting point have to be a PDF? steipete's suggestion of using a system to create the PDF would work if your app workflow could create the PDF (sans signature) and display it, the user "signs" it in your app, and you create the PDF again this time with the signature embedded. It depends on whether this flow is an option for your app. Often it seems easier if you treat PDF as a final document and produce the PDF in it's final form each time (final meaning that you're not going to try modifying it).

Resources