Question

i want add a javasript alert code to my pdf for showing some alert when i open it ... how could i do that? i found some paper and ebook like http://www.pdfill.com/download/AcroJS.pdf and http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/AcroJSGuide.pdf they explain it very dificult and complicated but my goal is very simple and actually i think it is not really necessary to know all of it's detail and i must mention that i develop a program for adobe acrobat reader in android
tnx for helping

Was it helpful?

Solution

the answer is in this project

we could create a pdf in c# like this:

using BitMiracle.Docotic.Pdf;

namespace JavascriptInPdf
{
public static class Demo
{
    public static void Main(string[] args)
    {
        PdfDocument pdf = new PdfDocument();

    pdf.OnOpenDocument =pdf.CreateJavaScriptAction("app.alert(\"Hello    CodeProject!\", 3);");

        pdf.Save("Hello world.pdf");
    }
}
  }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top