Print Page | Close Window

Sign pdf with associated image not showed

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2765
Printed Date: 06 Feb 26 at 7:47AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Sign pdf with associated image not showed
Posted By: briast
Subject: Sign pdf with associated image not showed
Date Posted: 22 Oct 13 at 9:58AM
Hello. Using 9.16, I try to sign a pdf with a PFX and add an image signature.
I use the next code from Roman Moderator on this thread:   http://www.quickpdf.org/forum/topic2563&OB=ASC.html" rel="nofollow - http://www.quickpdf.org/forum/topic2563&OB=ASC.html

------------------------------------------------
procedure TForm7.btnNewSignProcessFromFileClick(Sender: TObject);
var
SignProcessID: Integer;
begin
    DPL := TDebenuPDFLibrary0914.Create;
    if DPL.UnlockKey('..license_key_goes_here') = 1 then
    begin
      DPL.DrawText(100, 700, 'This is the file to be signed');
      DPL.SaveToFile('TheUnsignedFile.pdf');

      SignProcessID := DPL.NewSignProcessFromFile('TheUnsignedFile.pdf', '');
      if (SignProcessID > 0) then
      begin
        DPL.SetSignProcessPFXFromFile(SignProcessID, 'qpl_test.pfx', 'testing');
        DPL.SetSignProcessInfo(SignProcessID, 'To test digital signatures', 'The World', 'Contact me');
        DPL.SetSignProcessField(SignProcessID, 'Contract Signature');
        DPL.SetSignProcessFieldBounds(SignProcessID, 100, 600, 200, 100);
        DPL.SetSignProcessFieldImageFromFile(SignProcessID, 'visualsignature.jpg', 0);
        DPL.EndSignProcessToFile(SignProcessID, 'TheSignedFile.pdf');
      end;
    end;
end;
------------------------------------------------

The PDF file is signed good, but I can't see the image. I have tried changing the bounds, but nothing changes.
Any suggestion?



Replies:
Posted By: briast
Date Posted: 22 Oct 13 at 11:40AM
Hi. I have found the problem.
If before the sign process you change file permission with EncodePermission and Encrypt, then after sign process, the file is correctly signed but image is hidden.
I don't know if that is correct or no.


Posted By: Ingo
Date Posted: 23 Oct 13 at 7:31AM
Hi Briast,
 
i didn't try it but perhaps it's the line:
DPL.SetSignProcessFieldBounds(SignProcessID, 100, 600, 200, 100);
The coordinates are for x1, y1, x2, y2 ... i think ;-)
So if shown or not have to do where to start and how are the dimensions of your jpg.
I think you should use SetOrigin first.
 
Cheers and welcome here,
Ingo
 


-------------
Cheers,
Ingo



Posted By: briast
Date Posted: 23 Oct 13 at 8:55AM
Hi. Thanks for your help but as I said, the problem is if I change the permission.
If I don't change it, the image is showed without error.
I have another question that is how to make this image transparent. I try with png with transparency but it doesn't work.



Posted By: Rowan
Date Posted: 18 Nov 13 at 3:42AM
Hi briast,

It is not currently possible to digitally sign a PDF that has already been encrypted.

It is also not possible to apply the document permissions to the PDF after it has been signed as that would invalidate the digital signature.

Cheers,
- Rowan.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk