Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I create a blank PDF signature field using an HTML input document or after exporting to PDF using ABCPDF?
    primarykey
    data
    text
    <p>I have a source HTML document generated from an ASPX.</p> <p>I then convert the html to PDF using ABCPDF.</p> <p>The html has a signature area, which is just a text box with a border.</p> <p>I need a signature field inside the PDF with a name that I can pass on.</p> <p>The PDF will be sent to a third-party who will correspond with the client and then digitally sign the PDF and send it back.</p> <p>Given that I have an html document, or PDF, how do I programmatically add the blank PDF signature field around the original html signature area or somehow relate the two?</p> <p>Here is a sample application to demonstrate some of the things I'm doing:</p> <pre><code>namespace ABCPDFHtmlSignatureTest { using System.Diagnostics; using System.IO; using System.Reflection; using WebSupergoo.ABCpdf8; using WebSupergoo.ABCpdf8.Objects; /// &lt;summary&gt; /// The program. /// &lt;/summary&gt; public class Program { /// &lt;summary&gt; /// The file name. /// &lt;/summary&gt; private const string FileName = @"c:\temp\pdftest.pdf"; /// &lt;summary&gt; /// The application entry point. /// &lt;/summary&gt; /// &lt;param name="args"&gt; /// The args. /// &lt;/param&gt; public static void Main(string[] args) { var html = GetHtml(); var pdf = GetPdf(html); /* save the PDF to disk */ File.WriteAllBytes(FileName, pdf); /* open the PDF */ Process.Start(FileName); } /// &lt;summary&gt; /// The get PDF. /// &lt;/summary&gt; /// &lt;param name="html"&gt; /// The html. /// &lt;/param&gt; /// &lt;returns&gt; /// The &lt;see cref="byte"/&gt;. /// &lt;/returns&gt; public static byte[] GetPdf(string html) { var document = new Doc(); /* Yes, generate PDF fields for the html form inputs */ document.HtmlOptions.AddForms = true; document.AddImageHtml(html); /* We can determine the location of the field */ var signatureRect = document.Form["Signature"].Rect; MakeFieldsReadOnly(document.Form.Fields); return document.GetData(); } /// &lt;summary&gt; /// The get html. /// &lt;/summary&gt; /// &lt;returns&gt; /// The &lt;see cref="string"/&gt;. /// &lt;/returns&gt; public static string GetHtml() { using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ABCPDFHtmlSignatureTest.HTMLPage1.html")) { using (var streamReader = new StreamReader(stream)) { return streamReader.ReadToEnd(); } } } /// &lt;summary&gt; /// The make fields read only. /// &lt;/summary&gt; /// &lt;param name="fields"&gt; /// The fields. /// &lt;/param&gt; private static void MakeFieldsReadOnly(Fields fields) { foreach (var field in fields) { if (field.Name == "Signature") continue; field.Stamp(); } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload