Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Mar 01, 2018 9:10 am

Hi,

i'm signing a document with GraphicsMode = SignDetails setting Rectangle dimesion, but the signature rectangle was filled only in the first parte as you can see in the attached png.
Do you have any suggestion to fill all rectangle?
Below it is listed my code:
----------------------------------------------------------------------------------------------------------------------------
using (PdfDocument doc = new PdfDocument())
{
doc.LoadFromBytes(documentToSign);

//Retrieve coordinates to place the signature
float placeHolderOffset = -1;
PdfPageBase pageToSign;
PointF signaturePosition;
GetSignatureCoordinates(documentToSign, doc, placeHolder, out pageToSign, out signaturePosition, out placeHolderOffset);

//Calcolate signature dimension
float signatureHeight = 60;
float signatureWidht = 300;

//Generate signature

PdfCertificate signatureCertificate = new PdfCertificate(signatureInfo.Certificate, signatureInfo.CertificatePassword);
signatureCertificate.FriendlyName = signatureInfo.FormattedName;

PdfSignature signature = new PdfSignature(doc, pageToSign, signatureCertificate, "VitantonioAllegretti VitantonioAllegretti");

signature.GraphicsMode = GraphicMode.SignDetail;
signature.Name = "VitantonioAllegretti VitantonioAllegretti";
signature.Date = DateTime.Now;

signature.Bounds = new RectangleF(signaturePosition, new SizeF(signatureWidht, signatureHeight));

//Save document
using (MemoryStream ms = new MemoryStream())
{
doc.SaveToStream(ms, FileFormat.PDF);
signedDocument = ms.ToArray();
}
}
------------------------------------------------------------------------------------------------------------------------------------------------

Regards,

Vitantonio

vallegretti
 
Posts: 7
Joined: Mon Jul 17, 2017 3:25 pm

Thu Mar 01, 2018 10:30 am

Hello,

Thanks for your inquiry.
Sorry that our Spire.Pdf can't let the details fill the whole signature rectangle. For your situation, you could reach the effect by setting a larger font. Below is sample code for your reference.
Code: Select all
signature.GraphicsMode = GraphicMode.SignNameAndSignDetail;
signature.Name = "VitantonioAllegretti VitantonioAllegretti";
signature.Date = DateTime.Now;
//set SignDetail font and SignName font
signature.SignDetailsFont = new PdfFont(PdfFontFamily.TimesRoman, 15f);
signature.SignNameFont = new PdfFont(PdfFontFamily.TimesRoman, 15);

If there is any question, welcome to get it back to us.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Mon Mar 05, 2018 4:43 pm

Hello,

Thanks for your response, but your suggestion doesn't solve my problem: the name was splitted into two rows instead of expand himself in its row.

Do you have other suggestion?

Regards,

Vitantonio

vallegretti
 
Posts: 7
Joined: Mon Jul 17, 2017 3:25 pm

Tue Mar 06, 2018 7:02 am

Dear Vitantonio,

Thanks for your feedback.
I tried to increase the font size and reduce the signature width to reach the filling effect but didn't succeed, there is always the white space on the right. I will post the issue to our dev team and investigate if there is other approach can meet your requirement. If it can be achieved, we will let you know ASAP.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Fri Mar 16, 2018 5:19 am

Dear Vitantonio,

Thanks for your waiting.
Now the latest Spire.PDF Pack(Hot Fix) Version:4.3.4 fixes the reported issue, you could reach the filling effect by increasing the font size or reducing the signature width. Such as below code fragment.
Code: Select all
signature.GraphicsMode = GraphicMode.SignDetail;
signature.Name = "VitantonioAllegretti VitantonioAllegretti";
signature.Date = DateTime.Now;
//set SignDetail font
signature.SignDetailsFont = new PdfFont(PdfFontFamily.TimesRoman, 17f);

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Tue Mar 20, 2018 9:51 am

Hello,

Greetings from E-iceblue.
Did you test the hotfix?
Thanks in advance for your valuable and time.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Wed Apr 04, 2018 8:58 am

Nina.Tang wrote:Hello,

Greetings from E-iceblue.
Did you test the hotfix?
Thanks in advance for your valuable and time.

Sincerely,
Nina
E-iceblue support team



I Nina,

sorry for delay. I had tested successfully the latest version and i confirm that the issue is solved.

Best regards,

Vitantonio

vallegretti
 
Posts: 7
Joined: Mon Jul 17, 2017 3:25 pm

Wed Apr 04, 2018 9:09 am

Hello,

Thanks for your prompt reply.
Just feel free to contact us if you need any further assistance.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.PDF