PdfSignature font size and alignment

Technical support for Spire.PDF

Moderator: iceblue support

PdfSignature font size and alignment

Postby PtChatuthai » Mon Aug 07, 2017 10:10 am

Can we adjust the font size or change alignment of signature content? Thanks.
PtChatuthai
 
Posts: 1
Joined: Mon Aug 07, 2017 10:04 am

Re: PdfSignature font size and alignment

Postby Jane.Bai » Tue Aug 08, 2017 8:42 am

Hello,

Thanks for your inquiry.
In regards to your two requirements, our Spire.Pdf only supports modifying the font size at present. Please refer the following code.
Code: Select all
string sourcePDF = @"template.pdf";
            PdfDocument doc = new PdfDocument(sourcePDF);
            String pfxPath = "Demo.pfx";

            PdfPageBase page = doc.Pages[0];
            PdfCertificate digi = new PdfCertificate(pfxPath, "e-iceblue");
            PdfSignature signature = new PdfSignature(doc, page, digi, "demo");

            //change the font size of the content details, only several font is available
            signature.SignDetailsFont = new PdfFont(PdfFontFamily.Helvetica, 5f);
            signature.Bounds = new RectangleF(new PointF(10,100), new SizeF(300, 300));
            signature.IsTag = true;

            //fill the content
            signature.DigitalSignerLable= "Digitally signed by";
            signature.DigitalSigner = "Jane for Test";
            signature.DistinguishedName = "DN:";
            signature.LocationInfoLabel = "Location:";
            signature.LocationInfo = "London";
            signature.ReasonLabel = "Reason: ";
            signature.Reason = "Le document est certifie";
            signature.DateLabel = "Date: ";
            signature.Date = DateTime.Now;
            signature.ContactInfoLabel = "Contact:
            signature.ContactInfo = "123456789";
            signature.Certificated = false;

            signature.ConfigGraphicType = ConfiguerGraphicType.Picture;
            signature.ConfiguerGraphicPath = "pic.jpg";
            signature.DocumentPermissions = PdfCertificationFlags.AllowFormFill;
            signature.GraphicsMode = GraphicMode.SignImageAndSignDetail;
            doc.SaveToFile("11309.pdf");


If there's still any doubt, welcome to contact us.

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 626
Joined: Tue Nov 29, 2016 1:47 am

Re: PdfSignature font size and alignment

Postby Jane.Bai » Mon Sep 25, 2017 9:57 am

Hello PtChatuthai,

Glad to inform that the new feature, setting text alignment of signature content, is available now. Please download the hotfix Spire.PDF Pack(Hot Fix) Version:3.9.360 and use the code below to have a test.
Code: Select all
signature.SignTextAlignment=SignTextAlignment.Right;


Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 626
Joined: Tue Nov 29, 2016 1:47 am


Return to Spire.PDF

Who is online

Users browsing this forum: No registered users and 0 guests