Page 1 of 1

Handling EMF in PDF output

PostPosted: Thu Jul 19, 2012 5:00 am
by vargohoat
Hi,
We are facing a problem while converting a docx to a pdf. We're using the CreatePDF example and FOP. The PDF is not completely generated due to EMF files, and so we are trying to bypass this.

What we are trying to do is change the resulting FO by substituting the src path of the EMF with equivalent images in JPEG. However, we're not sure how to update the FO, and then make the process continue with the new FO.

Or if there is any established solution for using EMFs. We've gone through the forum for the same problems other people are facing, but did not find a possible solution for that.

Any help regarding this would be highly appreciated.

Best regards,
VH

Re: Handling EMF in PDF output

PostPosted: Thu Jul 19, 2012 7:56 am
by jason
Thinking along the lines you suggest (ie avoiding implementing support for EMF):

The image processing extension functions org.docx4j.model.images.WordXmlPictureE20.createXslFoImgE20 (for wp:inline|wp:anchor) and org.docx4j.model.images.WordXmlPictureE10.createXslFoImgE10 (for w:pict) use interface ConversionImageHandler. You could extend PDFConversionImageHandler to do what you want; then pass your image handler in via PdfSettings.

Or, you could pre-process the docx, doing the image substitution before you start the PDF output process.