bootstrap css не применяется в преобразованном pdf с использованием itext pdfhtml

Я пытаюсь просто программно преобразовать html-файл в pdf-файл, используя iText pdfHtml

Я использую htmlConverter для преобразования локального файла html в pdf. Но кроме текста и некоторых стилей css, он не может анализировать через загрузочные css и изображения.

public static void main(String[] args) throws IOException {
        LicenseKey.loadLicenseFile("src/main/resources/{key.xml}");
        File htmlSource = new File("test3.html");
        File pdfDest = new File("target/output12.pdf");


        new HelloWorld().createPdf(htmlSource, pdfDest);
    }

    /** 
     * Creates the PDF file.
     *
     * @param html the HTML as a String value
     * @param dest the path of the resulting PDF
     * @throws IOException Signals that an I/O exception has occurred.
     */
    public void createPdf(File src, File dest) throws IOException {
        ConverterProperties converterProperties = new ConverterProperties();
        HtmlConverter.convertToPdf(new FileInputStream(src), 
       new FileOutputStream(dest), converterProperties);
    }

Созданный PDF-файл не похож на html-файл.

0 ответов

Другие вопросы по тегам