I have a problem converting an rtf file in pdf A.
The problem is that the generated pdf doesn’t contain a part of the rtf file.
This line of the rtf file
“per i motivi esposti in premessa di approvare la spesa
di € 5.500,00 (IVA cpr.)”
is converted in pdf in this way:
"per i motivi esposti in premessa di approvare la spesa di € ,00 (IVA cpr.) "
The number disappears !!
I attach the rtf file, the generated pdf file.
This is the code involved:
public static void testConvertpdf() throws Exception {
System.out.println("begin");
byte[] file = getFile("test.rtf");
PdfAgent instance = new PdfAgent();
Documento docIn = new Documento();
docIn.setContenuto(file);
Documento doc = instance.convertToPdf(docIn);
FileUtils.writeByteArrayToFile(new File("output.pdf"), doc.getContenuto());
System.out.println("end");
}
PdfAgent:
public Documento convertToPdf(Documento file) throws Exception {
ByteArrayInputStream is = new ByteArrayInputStream(file.getContenuto());
com.aspose.words.Document doc = new com.aspose.words.Document(is);
PdfSaveOptions pdfOptions = new PdfSaveOptions();
pdfOptions.setCompliance(PdfCompliance.PDF_A_1_B);
ByteArrayOutputStream dstStream = new ByteArrayOutputStream();
doc.save(dstStream, pdfOptions);
Documento pdfFile = new Documento();
pdfFile.setContenuto(dstStream.toByteArray());
return pdfFile;
}
Thanks
It happens only if the text contains the character $ or € and there is something after written in bold.
I’m using aspose word 16.8.0