0

This is my first time with odftoolkit and I'm having an extrange error. I have an .odt template and when converting to pdf it looses data.

Example:

    **Title 1:**
Text 1.
    **Title 2:**
Text 2.

The thing is that cnverted PDF only have Text1 / text2 and nothin about the titles. Both are the same font but different heigth.

public static File convertir(File informe) throws Exception{
    logger.entry();
    File informePdf = null;
    String filePath = "";
    try{
        InputStream is = new FileInputStream(informe);
        filePath = informe.getAbsolutePath().replace(".ODT",".PDF");
        informePdf = new File(filePath);
        OutputStream os = new FileOutputStream(informePdf);
        ConversorPDF conversor = new ConversorPDF(is, os, false, true);
        conversor.convert();
        logger.trace("Convertido a PDF correctamente");
        return informePdf;
    }catch ( Exception e){
        logger.catching(e);
        throw e;
    }
}

Sorry for my english ;)

  • Please show us your code, otherwise we can't tell you where the error is and how to fix it – BackSlash Oct 17 '16 at 13:23
  • Edited. I've passed 3 .odts and works with two but there is one that does not work. It says "Convertido a PDF correctamente" but the PDF is incorrect – Endika Hernando Oct 17 '16 at 13:31
  • Error localized. The error was that in libreOffice this text was "list parameter" font type and not "Predeterminated Style". Hope it helps someone. – Endika Hernando Oct 17 '16 at 14:39

0 Answers0