|
|
Originally Posted by: Paul Rayman  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!
|
|
|
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.
|
|
|
I tried every way I thought but I still couldn't solve the problem, could you please give me detailed instructions.
|
|
|
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. :(
|
|
|
try to use pdfViewer1.PageToClient method to convert point from page coordinate space to user control coordinate space.
|
|
|
plz! help me
|
|
|
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
|
|
|
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.
|
|
|
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-AcrobatQuote: 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
|