I'm trying to create 1 master pdf from a list of pdf's from various URLs. I am using the PDFSharp namespace for the first time and I'm having trouble finding any good documentation on it as far as classes, members, etc., so I appreciate your help! I've created the following short little method to create my "Master PDF":
public PdfDocument CreateFinalPDF(PdfPage[] pages)
{
PdfDocument m_pdfFinalCutSheet = new PdfDocument(m_sFileName);
for (int i = 0; i < pages.Length; i ++)
{
m_pdfFinalCutSheet.AddPage(pages[i]);
}
return m_pdfFinalCutSheet;
}
I'm pretty sure that will work to compile everything, but the issue I'm having is loading the images to the PdfPage[]
. I need to do this from other PDF's that are located at URL's that I will have stored in a List<string>
.
I was looking at the PdfPage.AddWebLink
but I feel like that's just going to add a link to a URL (based on my astute deduction skills from the names of methods) rather than pulling an image from one. Any insight or help is greatly appreciated!!
PDFsharp can use local files and streams, but cannot work with files on the Internet (remote URLs).
So you need code that downloads the files from the URLs to make them usable with PDFsharp.
Your assumption about AddWebLink
is correct.