PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Nov 10, 2024 5:51 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Jul 05, 2016 5:02 pm 
Offline

Joined: Tue Jul 05, 2016 4:56 pm
Posts: 1
Hello,

I have been searching for an example how to add a signature field to a specific position on the page with no success.
Can you provide a little example?

Thanks,
Andrej.


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 13, 2023 10:24 pm 
Here's an ex..
Code:
using PdfSharp.Drawing;
using PdfSharp.Pdf;
using PdfSharp.Pdf.AcroForms;

class SignatureFieldExample
{
    static void Main()
    {
        const string filename = "Output.pdf";

        // Create a new PDF document
        PdfDocument document = new PdfDocument();

        // Add a page to the document
        PdfPage page = document.AddPage();
        XGraphics gfx = XGraphics.FromPdfPage(page);

        // Add a signature field to a specific position
        PdfAcroForm acroForm = document.AcroForm;
        PdfSignatureField signatureField = new PdfSignatureField(page, "SignatureField")
        {
            Left = XUnit.FromCentimeter(5),
            Top = XUnit.FromCentimeter(10),
            Width = XUnit.FromCentimeter(6),
            Height = XUnit.FromCentimeter(2)
        };
        acroForm.Fields.Add(signatureField);

        // Save the document
        document.Save(filename);
    }
}

I hope it helps..


Top
  
Reply with quote  
PostPosted: Tue Oct 31, 2023 3:37 pm 
Offline

Joined: Tue Oct 31, 2023 3:36 pm
Posts: 1
Hi Malaneha,

Which version of PdfShar^p are you using?

regards,
govert


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 16, 2023 7:49 am 
govertDW wrote:
Hi Malaneha,

Which version of PdfShar^p are you using?

regards,
govert



I'm using PdfSharp version 1.50.

Could you confirm the version of PdfSharp you're using to add signature fields?


Top
  
Reply with quote  
PostPosted: Mon Jan 01, 2024 5:56 pm 
Offline

Joined: Tue Dec 26, 2023 6:22 pm
Posts: 3
govertDW wrote:
Hi Malaneha,

Which version of PdfShar^p are you using?

regards,
govert


this code not working with PDFSharp 6.0


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group