We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

PDF signature location not matching image


The location of the signature in the PDF page do not match the image location in the page.

screenshot url: https://ibb.co/gtKjKN6

This is how I add the signature location and the image location:

PdfLoadedPage page = document.Pages[0] as PdfLoadedPage;
PdfGraphics graphics = page.Graphics;
PdfSignature signature = new PdfSignature(document, page, null, "Sig1");

Assembly myAssembly = Assembly.GetExecutingAssembly();
System.IO.Stream myStream = myAssembly.GetManifestResourceStream("img.pacman.png");
PdfBitmap signatureImage = new PdfBitmap(Image.FromStream(myStream));

//Sets signature information
signature.Bounds = new RectangleF(new PointF(0, 0), signatureImage.PhysicalDimension);

//Draws the signature image.
graphics.DrawImage(signatureImage, 0, 0);


Why it's doesn't match? Also, how can I identify the page corners (top-left, top-right, bottom-left, bottom-right) if I wanna put the signature and the image in any of these positions?

22 Replies

SL Sowmiya Loganathan Syncfusion Team April 30, 2019 12:32 PM UTC

Hi Ahmad, 

Greetings from Syncfusion. 

We were able to reproduce the reported issue and suspect that this to be a defect. Currently we are validating the same. We will update the further details by 3rd May, 2019. 

Regards, 
Sowmiya L 



SL Sowmiya Loganathan Syncfusion Team May 8, 2019 12:33 PM UTC

Hi Ahmad, 

Thanks for the patience. 
 
We confirm that the issue with “Position has been changed while adding signature in an existing PDF document” is a bug and the fix for this issue will be included in Vol 2 2019 release which will be available in the month of June. 
 
Regards, 
Sowmiya L 



AH Ahmad May 9, 2019 07:03 AM UTC

Thanks, I will wait for the update :)


SL Sowmiya Loganathan Syncfusion Team May 9, 2019 10:15 AM UTC

Hi Ahmad, 

We request you to visit our website for release updates. 

Regards, 
Sowmiya L 



ST Stavros July 30, 2019 05:59 AM UTC

I use the latest release (17.2460.0.34) and I have the same problem.

Can you suggest any workaround?



SL Sowmiya Loganathan Syncfusion Team July 31, 2019 12:10 PM UTC

Hi Stavros,  
 
We have checked with the issue “Position has been changed while adding signature in an existing PDF document” in the product version 17.2.0.34 which you have mentioned. The fix for this issue has been moved in the product version 17.2.0.34. Please refer the below release notes link for more details, 

We have created the sample to demonstrate the same from below, 

Kindly try the above sample in your end and let us know if you have any concerns on this. 

Regards, 
Sowmiya L 



ST Stavros August 4, 2019 10:43 PM UTC

Hi Sowmiya,

I suspect that there may be a bug on the Y property setter function. Can you verify it? I tried it with the latest NuGet version (17.2460.0.39).

I tried to set the signature bounds with the following code (VB.NET, it works similar on C#)
...
Dim doc As New PdfLoadedDocument(inputfile)
Dim page As PdfLoadedPage = doc.Pages(0)
Dim signature As New PdfSignature(doc, page, PDFCert, "Signature")
...

signature.Bounds = bounds

The Y value on the signature bounds is not equal with the Y value on the bounds variable.

NameValueType
bounds{X = 85.03937 Y = 85.03937 Width = 226.771667 Height = 113.385834}System.Drawing.RectangleF
signature.Bounds{X = 85.03937 Y = 480.188965 Width = 226.771667 Height = 113.385834}System.Drawing.Rectan
gleF

Then I tried this:

signature.Location = New SizeF(5, 5)

The result on the watch window is as shown on the table:

NameValueType
signature.Bounds{X = 5 Y = 560.228333 Width = 226.771667 Height = 113.385834}System.Drawing.RectangleF


SL Sowmiya Loganathan Syncfusion Team August 5, 2019 12:48 PM UTC

Hi Starvos, 

Currently we are validating the reported behaviour of “Y position has been changed when setting bounds to signature in PDF document”. We will update the further details by 07th August, 2019. 

Regards, 
Sowmiya L   




SL Sowmiya Loganathan Syncfusion Team August 7, 2019 11:25 AM UTC

Hi Starvos, 
 
We have confirmed that the issue with “Y position has been changed when setting bounds to signature in PDF document” is a defect and the patch for this issue will be available on 14th  August 2019.  
 
Regards, 
Sowmiya L 



ST Stavros August 19, 2019 08:31 AM UTC

Hi Sowmiya,

Is there any new estimated date for the patch?

Regards,
Stavros D


GK Gowthamraj Kumar Syncfusion Team August 20, 2019 02:04 PM UTC

Hi Starvos, 

Sorry for inconvenience caused.  

We have fixed the reported issue but due to technical issue in our end, we are unable to generate patch for this issue.  We will provide the patch for this issue by tomorrow (21st  August 2019) without fail. 
 
Regards, 
Gowthamraj K 



ST Stavros replied to Gowthamraj Kumar August 21, 2019 08:17 AM UTC

Hi Starvos, 

Sorry for inconvenience caused.  

We have fixed the reported issue but due to technical issue in our end, we are unable to generate patch for this issue.  We will provide the patch for this issue by tomorrow (21st  August 2019) without fail. 
 
Regards, 
Gowthamraj K 


Thank you!


SK Surya Kumar Syncfusion Team August 21, 2019 11:14 AM UTC

Hi Starvos, 

The issue with “Y position has been changed when setting bounds to signature in PDF document” has been fixed and the patch for this fix can be downloaded from the following location.   

Recommended approach - exe will perform automatic configuration  
Please find the patch setup from below location:  

Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment  
Please find the patch assemblies alone from below location:  

 
Assembly Version: 17.2.0.34  
 
Installation Directions :   
This patch should replace the files “Syncfusion.Pdf.Base.dll” under the following folder.  
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.5.1  
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\17.2.0.34 \precompiledassemblies\17.2.0.34 \4.0  

To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.  
Disclaimer :   
Please note that we have created this patch for version 17.2.0.34 specifically to resolve the following issue(s) reported in this/the Forum(s). 144285 

If you have received other patches for the same version for other products, please apply all patches in the order received.  
This fix will be included in our 2019 Volume 3 release which will be available by end of September 2019 tentatively. 

 
Surya Kumar 



ST Stavros August 22, 2019 05:29 PM UTC

Dear Kumar,

When I try to download the patcch I get the error "You are not authorized to download this patch.".

I will wait till the 2019 Volume 3 release.

Best regards,
Stavros D


SL Sowmiya Loganathan Syncfusion Team August 23, 2019 01:42 PM UTC

Hi Stavros, 

We will include the fix the issue “Y position has been changed when setting bounds to signature in PDF document” in upcoming weekly NuGet release which is expected to available by 27th August, 2019.  

Regards, 
Sowmiya L 



SL Sowmiya Loganathan Syncfusion Team August 27, 2019 05:38 AM UTC

Hi Stavros, 

We have included the code changes for the reported issue “Y position has been changed when setting bounds to signature in PDF document” in weekly NuGet release (v17.2.0.47) and it is rolled out today. Please find the NuGet package link from below, 
 

Please let us know if you need any further assistance on this. 

Regards, 
Sowmiya L 



JP Joao Paulo Lima Braga September 26, 2019 09:43 PM UTC

Thank you!
I was facing the same issue and I ended up here in this thread after googling it. I am very happy for you provided a fix for this bug. Thank you very much!


ST Stavros December 4, 2019 02:01 PM UTC

Thanks for the update.

It works almost fine.

There is still one small problem with some landscape pages.
In some cases the signature box (the one with the validation image) is positioned correctly, in some other cases it is rotated.
I try to insert the signature at x,y and it is positioned as if it was potitioned at x,y and then rotated to landscape.

To recreate the problem:
- create a file with word or other software.
- set the page orientation to "Landscape"
- print using "Adobe PDF" printer.

I attached a file that displays the problem.

I use the libraries v17.3.0.29.
Update: I also tried 17.3.0.30.

Attachment: Landscape_signed_2076c860.zip


SL Sowmiya Loganathan Syncfusion Team December 5, 2019 12:39 PM UTC

Hi Stavros, 

We have analyzed the reported issue with the provided document and found that the page in PDF is rotated to 90 degree. Please refer the below screenshot for more details, 

 

However currently we are analyzing about this and provide the further details by 9th December, 2019.  

Regards, 
Sowmiya Loganathan 
 



SL Sowmiya Loganathan Syncfusion Team December 10, 2019 05:07 AM UTC

Hi Stavros, 
 
At present we do not have support to handle the signature field based on the page rotation. We have considered this as a usability feature “Rotate signature appearance based on rotation” and patch for this feature implementation is estimated to be available on 23rd December 2019. 
 
Regards, 
Sowmiya Loganathan 



SD Stavros Dimopoulos December 13, 2019 10:31 AM UTC

Thank you!


MK Moorthy Karunanithi Syncfusion Team December 23, 2019 02:11 PM UTC

Hi Stavros,  
 
The patch for this fix can be downloaded from the following location.      
   
Recommended approach - exe will perform automatic configuration     
Please find the patch setup from below location:     
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment     
 
Please find the patch assemblies alone from below location:     
 
 
Assembly Version: 17.4.0.39 
    
Installation Directions :      
This patch should replace the files “Syncfusion.Pdf.Base.dll” under the following folder.     
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.6    
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\17.4.0.39\precompiledassemblies\17.4.0.39\4.6  
   
To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.     
    
Disclaimer :      
Please note that we have created this patch for version 17.4.0.39 specifically to resolve the following issue(s) reported in this/the Forum(s). 144285 
   
If you have received other patches for the same version for other products, please apply all patches in the order received.     
   
This fix will be included in our 2019 Volume 4  SP1 release which will be available by end of January 2020 tentatively.    
 
Regards, 
Moorthy K 


Loader.
Live Chat Icon For mobile
Up arrow icon