PDF 1.5 to 1.4 conversion

Hi,

We are using the Aspose words to convert a word document to the PDF. The PDF file generated is as per PDF 1.5 specification. We want the output PDF to be of the type PDF 1.4 specification. Is there a way to change the setting so that the PDF output is of the PDF1.4 version instead of 1.5. If this is not possible can you please suggest an alternate way to convert PDF 1.5 to PDF 1.4. The PDF we need to convert is of size more than 50MB.

Thanks.

Hi Madhura,

Thanks for your query. Please use the following code snippet for your requirement. You can use PdfSaveOptions to convert your document to desired PDF file.

<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>PL</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val=“–”/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:10.0pt; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:47.9pt; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:Arial; mso-bidi-theme-font:minor-bidi;}

<![endif]–>

Document doc = new Document(MYDir + "in.docx");

PdfSaveOptions options = new PdfSaveOptions();

//options.setCompliance(PdfCompliance.PDF_15);

options.setCompliance(PdfCompliance.PDF_A_1_B);

doc.save(MYDir+ "AsposeOut.pdf", options);



PDF_15 : The output file will comply with the PDF 1.5 standard.


PDF_A_1_B : The output file will comply with the PDF/A-1b standard. PDF/A-1b has the objective of ensuring reliable reproduction of the visual appearance of the document.


Please let us know if you have any more queries.


Hi
Madhura,

In addition, you can use Aspose.Pdf component to be able to perform this conversion. Please see the following code snippet:

//open document
Document pdfDocument = new Document("d:/pdftest/test2.pdf");
// create conversion log file
pdfDocument.Convert("D:/pdftest/ConversionLog.txt", PdfFormat.v_1_4, ConvertErrorAction.Delete);
// save the updated document
pdfDocument.Save("d:/pdftest/Converted_Document.pdf");

I hope, this will help.

Best Regards,

Hi,

Thanks for the reply.

For using the Aspose.Pdf component do we need to download any additional jar other than aspose.pdf-3.2.jdk.16.jar but i am not able to find the document and PDFFormat in the jar.

Could you please let me know if I should download some additional jars?

Thanks

Hi
Madhura,

Please download the jar files of Aspose.Pdf for Java from following link. Let us know if you have any more queries.

Hi,

I have downloaded the aspose.pdf-3.2.jdk15.jar but the below code is not compiling. The downloaded jar does not have Document class in it. Please let me know the additional jars required so that I can execute the below code.

Thanks.

//open document

Document pdfDocument = new Document("d:/pdftest/test2.pdf");<?XML:NAMESPACE PREFIX = O />

// create conversion log file

pdfDocument.Convert("D:/pdftest/ConversionLog.txt", PdfFormat.v_1_4, ConvertErrorAction.Delete);

// save the updated document

pdfDocument.Save("d:/pdftest/Converted_Document.pdf");

Hi
Madhura,

Thanks for your query. Your query is related to Aspose.PDF. I am moving this thread to Aspose.PDF forum. My colleagues will reply you shortly.

Hi Madhura,


Thanks for using our products.

Please note that Document class is present in Aspose.Pdf for .NET and as per my understanding you need to convert the version of PDF document in Java environment. We have a product named Aspose.Pdf.Kit for Java which supports the feature to manipulate/edit existing PDF documents but I am afraid currently it does not support the feature to convert the PDF file with higher version into lower version. Nevertheless for the sake of correction, we already have logged this requirement as PDFKITJAVA-13517 in our issue tracking system. Our development team is working hard on supporting this feature and as soon as we have made significant progress towards its implementation, we would be more than happy to update you with the status of correction.

Please be patient and spare us little time. We are sorry for this inconvenience.