Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Aug 01, 2023 6:19 pm

Hi,

I am using FreeSpire.Doc version 9.9.7 to convert document to pdf using SaveToStream. It is working fine but I noticed that the PDF version of the generated document is 1.3
Is that possible to generate a pdf version 1.6 or above?

Thank You.

rakeshnsw
 
Posts: 4
Joined: Wed Feb 15, 2023 6:16 pm

Wed Aug 02, 2023 3:41 am

Hello,

Thank you for your inquiry.
You can use the following code to specify the converted PDF version:
Code: Select all
            Document document = new Document();
            document.LoadFromFile("F:\\Test.docx");
            MemoryStream stream = new MemoryStream();
            document.SaveToStream(stream, Spire.Doc.FileFormat.PDF);
            PdfDocument pdfDocument = new PdfDocument();
            pdfDocument.LoadFromStream(stream);           
            pdfDocument.FileInfo.Version= PdfVersion.Version1_6;
            pdfDocument.SaveToFile("F:\\result.pdf", Spire.Pdf.FileFormat.PDF);

If you have any other questions or concerns, please feel free to contact us anytime.

Sincerely,
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Return to Spire.Doc