|
1) I'm using the code before proceed to sign the document. The "Translate" and "Rotate" occurs before some lines of DrawImage and DrawString I have here. The signature rotates well, but:
a) if using signature.Appearance.Normal.Graphics.TranslateTransform(signature.Appearance.Normal.Height, signature.Appearance.Normal.Width) it appears cropped, like a square instead a rectangle (which it is originally).
b) if I swap WIDTH and HEIGHT, the field appears (I see the changed cursor over it) but no one text/image appears there.
2) As I said above, I'm using your code just before DRAW anything. But I was wondering if would be better to SAVE the document with the original signature position and size and, right after, open it, translate and rotate the field and save it again with a new name. Do you see any advantage to perform the rotation this way?
|
While adding text or image in signature appearance with translate transform, we need to calculate the correct bounds (based on the translate transform bounds) and add it in DrawString method. We have created the sample to achieve your requirement and please download link,
Sample: https://www.syncfusion.com/downloads/support/forum/155828/ze/DigitalSignatureSample-48936337
Please try the above sample in and let us know the result.
Regarding second query: The rotation of string can be handled in draw string method of signature appearance. So there is no need to save the PDF and again with rotation. |
|
I can't rotate the rectangular custom label made to the signature without crop it... I guess the problem is related to the SIGNATURE field itself, which is not a square (and really it cannot be since there are other fields in the same page).
I was wondering if would be interesting to create all graphic text and images (logo) using DRAWSTRING and DRAWIMAGE as I perform now, but instead to use it directly into the SIGNATURE field as I do, make them in a graphic space (how can I get it?), then save it as a PNG and only after these steps load the image into a vertical SIGNATURE field.
What do you think about it?
|
Could you please let us know the further details about your requirement. It will helpful for us to provide the precise solution on this. |
|
I tried using BITMAP and ROTATECLIP method of Graphics successfully getting the rotated image into the signature field.
But even using Hi-Quality settings of antialiases, I can't have the text using the same quality I see if using PDFBrush, PDFPen and the Drawstring method of PDFSignature.Appearance.Normal.
Look my attachment to see the ugly image I have, even using the below code:
bmp.SetResolution(300, 300)
Dim graphics__1 As Graphics = Graphics.FromImage(bmp)
graphics__1.PageUnit = GraphicsUnit.Pixel
graphics__1.CompositingQuality = CompositingQuality.HighQuality
graphics__1.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
graphics__1.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
graphics__1.PixelOffsetMode = Drawing2D.PixelOffsetMode.HighQuality
graphics__1.TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit
graphics__1.Clear(Color.Transparent)
So, I guess I'm in a corner now:
- if using Syncfusion methods, I get the best text resolution but cannot rotate the signature if I have a rectangular field (mainly if it has small height).
- to rotate image using my own bitmap and RotateFlip method of Graphics (simples and efficient) to achieve what I want, either using Drawstring or Path I have a "blur" text on my image (see attachment).
Do you have any idea of how can I bypass that problem?
|
We have analyzed the provided image file and found that the blur text in image file itself. Due to this only this issue occurs. However, we can able to add image in rotated signature with rectangular field (small height) by resizing the image. Please refer the below sample for your reference,
Sample: https://www.syncfusion.com/downloads/support/forum/155828/ze/DigitalSignatureSample1062433470
|