Copy link to clipboard
Copied
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;
Have something to add?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now