I have a need to create 4 PDF files from different MS Office documents, and append them together into one final document. All of this is happening server side using a .NET Web Service (in C#).
I am able to create my 4 PDF files, and the code to append them together executes with no errors, but when I try to Save the resulting document, it fails with a non-descriptive error message. I can't tell what's happening.
Is there a time limit on functionality in the demos that could be causing this? Also, the documents are not all the same orientation (Landscape / Portrait). Could this be the issue?
Below I have pasted the code I am using to append the documents together. Thanks.
Code: Select all
// Init the PDFCreator
PDFCreator.PDFCreactiveXClass pdfGen = new PDFCreator.PDFCreactiveXClass();
// Open the first file (pathList is an array of paths to the 4 files)
pdfGen.Open(pathList[0], "");
// Now append the rest
for(int pathIndex = 1; pathIndex < pathList.Length; pathIndex++) {
string nextPath = pathList[pathIndex];
pdfGen.Append(nextPath,"");
}
// Create a temp path to save to
string destPath = this._tempDir + "\\" + this._random.Next(10000).ToString() + ".pdf";
// Now Save (---- FAILS HERE----)
pdfGen.Save(destPath, PDFCreator.FileSaveOptionConstants.acFileSaveView);