Change version of PDF in PDF created using Aspose

Hi Team,

Currently when we create PDF using Aspose PDF v 9.2, the version of PDF we get is version 1.7. But when we create using v9.0 we get version of PDF as 1.4. We would like to set version of PDF generated as less than 1.5 no matter which version of Aspose PDF we use.

Thanks & Regards,

Anish C

Hi Anish,

Thanks for your inquiry. Please note that by default, Aspose.Pdf.Document() creates a new PDF document with version 1.7, and Aspose.Pdf.Generator creates a 1.4 PDF version. When using Aspose.Pdf for .NET, you may try using the following code snippet to save the PDF file in a particular version.

// instantiate Document object
Aspose.Pdf.Document pdfdoc = new Aspose.Pdf.Document();

// add page to PDF file
pdfdoc.Pages.Add();

// set PDF file version
pdfdoc.Convert(new MemoryStream(), PdfFormat.v_1_4, ConvertErrorAction.Delete);

// save PDF file
pdfdoc.Save("output.pdf");

Please feel free to contact us for any further assistance.

Best Regards,