Note that there are some explanatory texts on larger screens.

plurals
  1. POPDFNet trying to add a text not working
    text
    copied!<p>I am basically trying out PDFNet and tweaking one of the samples of PDFNet. Here is the code:</p> <pre><code> PDFNet.Initialize(); // Relative path to the folder containing test files. string input_path = "../../../../TestFiles/"; string output_path = "../../../../TestFiles/Output/"; PDFDoc doc = new PDFDoc(input_path + "form1.pdf"); for (int index = 1; index &lt;= doc.GetPageCount(); index++) { Page page = doc.GetPage(index); ElementBuilder eb = new ElementBuilder(); // ElementBuilder is used to build new Element objects eb.Reset(); // Reset GState to default ElementWriter writer = new ElementWriter(); // ElementWriter is used to write Elements to the page writer.Begin(page); // Begin writing a block of text string data = "Page " + index; Element element = eb.CreateTextRun(data, Font.Create(doc, Font.StandardType1Font.e_times_roman, true), 100.0); element.SetTextMatrix(10, 0, 0, 10, 100, 100); GState gstate = element.GetGState(); gstate.SetTextRenderMode(GState.TextRenderingMode.e_stroke_text); gstate.SetStrokeColorSpace(pdftron.PDF.ColorSpace.CreateDeviceRGB()); gstate.SetStrokeColor(new pdftron.PDF.ColorPt(1, 0, 0)); writer.WriteElement(element); writer.End(); writer.Dispose(); // save changes to the current page } doc.Save(output_path + "element_builder.pdf", SDFDoc.SaveOptions.e_linearized); doc.Close(); </code></pre> <p>But problem is, no text is added to <code>element_builder.pdf</code>. It is just copied as it is and looks same as <code>form1.pdf</code>. Can anybody help me out?</p> <p>This is the link to PDFNet <a href="http://www.pdftron.com/pdfnet/downloads.html" rel="nofollow">http://www.pdftron.com/pdfnet/downloads.html</a></p> <p>I am using 64 bit version for .Net 4.0</p>
 

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