Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Merging PDF Files in ASP.NET

New Here ,
Mar 02, 2016 Mar 02, 2016

I am using C# and asp.net

I have the following code to combine two PDF files.

This runs in debug mode. But it does not from the web client. What do I need to do to make this work? Thanks much in advance.

                String filePath = GlobalVar.excelSavedFilePath;

                inFileName  =  "input.pdf";

                appendFileName = "append.pdf";

                DirectoryInfo dirInfo = new DirectoryInfo(GlobalVar.excelSavedFilePath);

                outFileName = GlobalVar.excelSavedFilePath + "out1.pdf";

                Type AcrobatPDDocType;

                AcrobatPDDocType = Type.GetTypeFromProgID("AcroExch.PDDoc");

                Acrobat.CAcroPDDoc src = (Acrobat.CAcroPDDoc)Activator.CreateInstance(AcrobatPDDocType);

                Acrobat.CAcroPDDoc dest = (Acrobat.CAcroPDDoc)Activator.CreateInstance(AcrobatPDDocType);

                src.Open(filePath + inFileName);

                dest.Open(filePath + appendFileName);

                src.InsertPages(src.GetNumPages() - 1, dest, 0, dest.GetNumPages(), 0);

                src.Save(1, outFileName);

                src.Close();

                dest.Close();

                msg = "Merged";

                return msg;

TOPICS
Acrobat SDK and JavaScript , Windows
361
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation