I am working with an established application where PDFReactor 5.1 is in use. The company will not upgrade it for a while (maybe another 1-2 years).
I was tasked with building functionality to merge pdf files (a appending all pdfs will do) from a C# based web application.
Reading though the old docs of this tool (which are from 2012) I have found they propose this type of usage:
To merge multiple PDFs use the methods setMergeURLs or setMergeByteArrays
String[] urls = {"http://www.myserver.com/overlaid1.pdf", "http://www.myserver.com/overlaid2.pdf"}; pdfReactor.setMergeURLs(urls); pdfReactor.setMergeMode(PDFreactor.MERGE_MODE_APPEND);
However, the documentation does not specify what method to call to render the merged pdf and setMergeURLs
does not return a value (public void SetMergeURLs(string[] urls)
)
I can see there are 3 render methods, when I explore the client DLL, but all of them require some input (presumably in addition to the pdf you set with setMergeURLs
):
public byte[] RenderDocumentFromByteArray(byte[] byteArray)
public byte[] RenderDocumentFromContent(string content)
byte[] RenderDocumentFromURL(string URL)
I tried using these 3 render methods but they only result on an empty array with the following error:
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
it seems PDF reactor is trying to do a conversion from XML to pdf instead of the merge...
what am I missing??