2

I need to convert a docx in `pdf. This is the starter docx:

enter image description here

The document docx has something like a table border and other table ( in the docx at the end , belove the two fields, there are a lot of rows with black border). Another problem is that this pdfConvert doesn't print the input that I have put in the document

So My code is this:

XWPFDocument doc = new XWPFDocument(new FileInputStream(originalPathSource));

PdfOptions options = PdfOptions.create();

        OutputStream out = null;
        try {
            out = new FileOutputStream(new File(targetFileName));

            PdfConverter.getInstance().convert(docx, out, options);
            out.flush();
            out.close();
}..

My libraries are:

    <properties>
        <versioniApache>4.0.1</versioniApache>
        <versioniApachePDF>1.0.6</versioniApachePDF>
        <versioniApacheSchema>4.1.2</versioniApacheSchema>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>${versioniApache}</version>
        </dependency>


        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>${versioniApache}</version>
        </dependency>

        
<dependency>
    <groupId>fr.opensagres.xdocreport</groupId>
    <artifactId>fr.opensagres.poi.xwpf.converter.pdf</artifactId>
    <version>2.0.2</version>
</dependency>

The pdf's result has only the words in the docx and it lsoes the table border outside and inside. Anyone can help me?

JoeB
  • 201
  • 2
  • 4
  • 9
  • 1
    The `fr.opensagres.poi.xwpf.converter.pdf.PdfConverter` does not consider any text boxes and/or any shapes except of pictures until current version `2.0.2`. – Axel Richter Feb 15 '21 at 09:44
  • @AxelRichter but in my pom I have the 2.0.2 so the problem is not that! – JoeB Feb 15 '21 at 09:51
  • Even version version `2.0.2` does not consider any text boxes and/or any shapes except of pictures. Maybe later version will, but there are not any until now. – Axel Richter Feb 15 '21 at 09:53
  • @AxelRichter which libraries I must use to work my conversion? – JoeB Feb 15 '21 at 09:56
  • I don't know. But see https://stackoverflow.com/questions/3022376/how-can-i-convert-a-word-document-to-pdf. – Axel Richter Feb 15 '21 at 10:12

0 Answers0