|
using BitMiracle.Docotic.Pdf;
namespace JavascriptInPdf
{
static class Names
{
public static void Run()
{
PdfDocument pdf = new PdfDocument();
pdf.Open(Resources.NamesPdf);
pdf.SharedScripts.Add(
pdf.CreateJavaScriptAction(Resources.SynchronizeFields)
);
pdf.GetControl("name0").OnLostFocus = pdf.CreateJavaScriptAction("synchronizeFields(\"name0\", \"name1\");");
pdf.GetControl("name1").OnLostFocus = pdf.CreateJavaScriptAction("synchronizeFields(\"name1\", \"name0\");");
pdf.Save("NamesModified.pdf");
System.Diagnostics.Process.Start("NamesModified.pdf");
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Vitaliy Shibaev is a developer and co-founder of
Bit Miracle, company developing the Docotic.Pdf, Jpeg2000.Net, LibTiff.Net libraries.
Docotic.Pdf - pure .NET library for PDF processing. It is a high-quality library for text extraction, PDF to image conversion, compressing PDF, and other PDF tasks.
Jpeg2000.Net - the library for encoding/decoding JPEG 2000 images in .NET.