We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to set the version of merged PDF

I'm using the following code to merge list of PDF documents.

Questions:

1> What would be the version of the final merged pdf?

2>Can we set the PDF version of final merged pdf?

public void Merge(IList input, Stream output)
{
using (Aspose.Pdf.Document finalPdf = new Aspose.Pdf.Document())
{
foreach (Stream s in input)
{
using (Aspose.Pdf.Document doc = new Aspose.Pdf.Document(s))
{
finalPdf.Pages.Add(doc.Pages);
}
}

finalPdf.Save(output);
}
}

Hi Laxmikant,


Thanks for using our API.

Once the PDF files are concatenated, please try using the following code snippet to set the PDF file version.

[C#]

//
load PDF document

Document doc = new Document("c:/source.pdf");

// set the PDF file version

doc.Convert(new MemoryStream(), PdfFormat.v_1_7, ConvertErrorAction.Delete);

// save updated file

doc.Save("updated.pdf");

Can you please also answer the first question? Which version Aspose will use by default when it concatenate PDFs? In above code, if the source PDFs are of different version then what would be merged PDFs version

Hi Laxmikant,


Thanks for your inquiry. Please note according to concatenation code, we are copying pages from other documents to Parent PDF document (finalPdf). API will preserve the version of Parent PDF document for concatenated PDF.

Please feel free to contact us for any further assistance.

Best Regards,

but the parent PDF is created using the code

Aspose.Pdf.Document finalPdf = new Aspose.Pdf.Document()

so which version does aspose use to create blank PDF document

Hi Laxmikant,


Thanks for your inquiry. In case you are creating a new file form scratch Aspose.Pdf.Document will create a file with version 1.7.

Please feel free to contact us for any further assistance.

Best Regards,