You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
It is not possible to add PNG image into RTF document.
Following exception is thrown:
com.lowagie.text.DocumentException: Only BMP, PNG, WMF, GIF and JPEG images are supported by the RTF Writer
at com.lowagie.text.rtf.graphic.RtfImage.<init>(RtfImage.java:179)
at com.lowagie.text.rtf.RtfMapper.mapElement(RtfMapper.java:168)
at com.lowagie.text.rtf.RtfWriter2.add(RtfWriter2.java:186)
at com.lowagie.text.Document.add(Document.java:302)
Steps to reproduce:
The problem can be reproduce by adding following code into CreateSimpleRTFDocumentTest.java file:
The "pngnow.png" file is taken from LibrePDF/OpenPDF source code.
Note: Adding JPG file works without problems.
Edited:
It seems that problem was introduced by this commit in OpenPDF repository. The class PngImage.java (and others) was removed. As a result the method setOriginalType(Image.ORIGINAL_PNG) is now not called at all.
The text was updated successfully, but these errors were encountered:
Summary:
It is not possible to add PNG image into RTF document.
Following exception is thrown:
Steps to reproduce:
The problem can be reproduce by adding following code into
CreateSimpleRTFDocumentTest.java
file:The "pngnow.png" file is taken from LibrePDF/OpenPDF source code.
Note: Adding JPG file works without problems.
Edited:
It seems that problem was introduced by this commit in OpenPDF repository. The class PngImage.java (and others) was removed. As a result the method
setOriginalType(Image.ORIGINAL_PNG)
is now not called at all.The text was updated successfully, but these errors were encountered: