Page 1 of 1

Conversion photos and tables from docx to pdf?

PostPosted: Tue Jun 03, 2008 12:47 am
by drkeselj
Hello,

I`ve tried docx4j, but it not works with photos and tables.
Simple text is ok.
So, does in docx4j some support for converting tables and pictures from docx to pdf file?
And if it is not, where I can find that?

Thanx

Re: Conversion photos and tables from docx to pdf?

PostPosted: Mon Jun 16, 2008 7:52 pm
by jason
I`ve tried docx4j, but it not works with photos and tables.
So, does in docx4j some support for converting tables and pictures from docx to pdf file?


Hi

The situation is as follows.

docx4j can consume a table and create org.docx4j.wml.* classes from it.

There is also some support for rendering a table as PDF. (To create a PDF, the document is first transformed to HTML. The w:tbl is converted to a simple HTML table.)

As to images, this requires support for the drawingml namespaces:

  • http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
  • http://schemas.openxmlformats.org/drawingml/2006/main
  • http://schemas.openxmlformats.org/drawingml/2006/picture

Let me know if you are still interested (I only just noticed your post) - and if so, I will prioritise adding image support

.. Jason

Re: Conversion photos and tables from docx to pdf?

PostPosted: Fri Jul 18, 2008 1:02 pm
by jason
As of today, the code in SVN supports the drawingml namespace enough to build an object model for a w:drawing such as:

Code: Select all
            <w:drawing>
               <wp:inline distT="0" distB="0" distL="0" distR="0">
                  :
                  <a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
                     <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
                        <pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">
                           :
                           <pic:blipFill>
                              <a:blip r:embed="rId5" />
                              :
                           </pic:blipFill>
                           :
                        </pic:pic>
                     </a:graphicData>
                  </a:graphic>
               </wp:inline>
            </w:drawing>


See this sample

From the relationship ID for the image, you can get the relevant binary part.