I am creating a new PDF file by adding several different file types. One of the files I have to add is another pdf. I am unable to figure this out.
Can you help?
My code goes like this…
Aspose.Pdf.Generator.Pdf pdfx = new Pdf();
Aspose.Pdf.Generator.Section sec = pdfx.Sections.Add();
Aspose.Pdf.Generator.Text txtx = new Text(“Hello World”);
sec.Paragraphs.Add(txtx);
// I now need to add a PDF file and then save pdfx
// add HelloPDF.pdf to pdfx
// save pdfx
pdfx.Save(“HelloWorld2.pdf”);
Hi Prakash,
Thanks for the tip about concatenating. I had considered it, but relegated it as a last resort.
The requirement I have is to put together various files into a single pdf - mostly the files are of type TIF, TEXT and PDF. It would be nice to be able to write to a single output pdf file without switching over to a different process for one of the file types.
Is there a way to do this with just the Document object and not using Generator?
Thanks
Hi Prakash,
Thanks for sample on using the Document object.
I was able to use this for my purposes.
When I was using Generator for Text files I was able to use the Section object for setting PageHeight and PageWidth
Example
Aspose.Pdf.Generator.Section sec1 = _pdf1.Sections.Add();
sec1.PageInfo.PageHeight = Aspose.Pdf.Generator.PageSize.A3Height;
sec1.PageInfo.PageWidth = Aspose.Pdf.Generator.PageSize.A3Width;
Is there something similar I can use with the Page object within the Document object?
Thanks