logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
thanghv Posted: Friday, April 5, 2019 12:48:35 AM(UTC)
 
Originally Posted by: Paul Rayman Go to Quoted Post
Hi,

Use the following rect instead of yours
Code:
Rectangle rect = new Rectangle((int)pageX, (int)pageY - (int)pageH, (int)pageW, (int)pageH);

Also use SignaturePosition to align the signature in the rectangle.


Great, thank you so much!
Paul Rayman Posted: Thursday, April 4, 2019 7:29:30 AM(UTC)
 
Hi,

Use the following rect instead of yours
Code:
Rectangle rect = new Rectangle((int)pageX, (int)pageY - (int)pageH, (int)pageW, (int)pageH);

Also use SignaturePosition to align the signature in the rectangle.
thanghv Posted: Wednesday, April 3, 2019 8:23:42 PM(UTC)
 
I tried every way I thought but I still couldn't solve the problem, could you please give me detailed instructions.
thanghv Posted: Thursday, March 28, 2019 8:04:27 PM(UTC)
 
I did the drawing with pdfViewer1.PageToClient, you can look at my project, but it doesn't seem to be the location I need to identify the signature on the page. :(
Paul Rayman Posted: Thursday, March 28, 2019 4:09:17 AM(UTC)
 
try to use pdfViewer1.PageToClient method to convert point from page coordinate space to user control coordinate space.
thanghv Posted: Wednesday, March 27, 2019 7:26:47 PM(UTC)
 
plz! help me
thanghv Posted: Sunday, March 24, 2019 8:09:48 PM(UTC)
 
Hi Paul,

Thank you for sharing, my project is similar to Adobe reader DC, when users open the file on pdfviewer, users will choose the location to attach the digital signature to that pdf file by drawing a rectangle to locate the signature location.

Below is my demo project
Step1: open file
step2: click drawing -> mouse down, hover to draw
step3: click sign

Link project :https://drive.google.com/file/d/1e7LEL-_FOLzop9jAwLhQMxUIFYrtG7Q5/view?usp=sharing

My problem as mentioned above, I cannot get the exact position that the user draws on pdfviewer, you can run my project and see that after signing the signature position, it is deviated from drawing.
I hope to receive your help, plz. Thanks
Paul Rayman Posted: Saturday, March 23, 2019 6:13:21 AM(UTC)
 
Hi,

lt and rb in the code you provided is a left-top and right-bottom corner of the rectangle in PDF points in user space coordinate system.
In the PDF documents, the origin of default user space always corresponds to the lowerleft corner of the page.

The contents of a page ultimately appear on a raster output device such as a display or a printer. Such devices vary greatly in the built-in coordinate systems they use to address pixels within their imageable areas. A particular device’s coordinate system is called its device space.
For the monitor the origin corresponds to the topleft corner of the screen.

I don't know what exactly means the Rectangle in the iTextSharp, but seems you need convert both lt and rb from one coordinate system to another. Given that you need integer coordinates, then most likely these are coordinates on the target device (monitor?)

Without knowing the details of your project it is extremely difficult to advise something specific.
thanghv Posted: Saturday, March 23, 2019 2:26:47 AM(UTC)
 
Hello everyone,

I'm a new member and also new programmer c #, I had trouble switching from a RectangleF to Rectangle

On the viewing screen, I clicked e to drag the mouse to make a rectangle and took the position to attach a digital signature, when I dragged the mouse I got the position type RectangleF, but my signature library(ItextSharp) use type Rectangle. . How to convert position selection when drag the mouse and position signature is aligned correctly?

I consulted and used the rectangular mouse drag in this article:
https://forum.patagames....hot-feftality-as-Acrobat

Quote:

PointF lt;
PointF rb;
NormalizeSnapshotPoints(out lt, out rb);
//The rectangle on a page in PDF coordinates which should be snapshoted.
float pageX = lt.X;
float pageY = lt.Y;
float pageW = rb.X - lt.X;
float pageH = lt.Y - rb.Y;

Rectangle rect = new Rectangle((int)pageX, (int)pageY, (int)pageW, (int)pageH);

If converting directly to int as above, it will be skewed

Sorry,my English is very bad, looking forward to receiving everyone's help. Thanks so much