EMF image cannot be inserted into PDF with latest Java Aspose.Pdf release.
Is there any plan (a date) to support EMF?
We’re evaluating PDF library.
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thank you for considering Aspose.Pdf for Java.
Well, I am afraid; currently Aspose.Pdf for Java does not support adding EMF images to PDF. The new feature request has been already included in our issue tracking system with issue id: PDFJAVA-31650. However, this issue may not be included in the release in near future due to the complexity of the issue. We will update you via this forum thread once there is any update regarding this issue.
Sorry for the inconvenience,
Any update on emf and pdf?
Hi there,
Many thanks.
Is there any way we could get <!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><span style=“font-size:11.0pt;font-family:“Calibri”,“sans-serif”;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:
“Times New Roman”;color:#1F497D;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”> a beta of the Aspose.Pdf for Java? so we could test to see if it will work for us. Our project has very tied schedule, otherwise, we’ve to look for a different library.
<!–[if gte mso 10]>
<![endif]–>
Hi there,
My testing indicates that emf still doesn’t work under aspose.pdf-new-4.0.0.jar
I attached text.emf
exception: java.lang.IllegalArgumentException: Invalid image or template handle in PlaceImage method.
at aspose.pdf.figure.Image.placeImage(Unknown Source)
at aspose.pdf.xml.ImageGenerator.writeImage(Unknown Source)
at aspose.pdf.xml.PageGenerator.a(Unknown Source)
at aspose.pdf.xml.b.a(Unknown Source)
at aspose.pdf.xml.GeneratorXml.generateDocument(Unknown Source)
at aspose.pdf.Pdf.save(Unknown Source)
//////////////////////////////////////////////////////////////////////////////////////
final aspose.pdf.Pdf pdf1 = new aspose.pdf.Pdf();
// Create a section in the Pdf object
final aspose.pdf.Section sec1 = pdf1.getSections().add();
// Create an image object in the section
final aspose.pdf.Image img1 = new aspose.pdf.Image();
// Add image object into the Paragraphs collection of the section
sec1.getParagraphs().add(img1);
img1.getImageInfo().setImageFileType(aspose.pdf.ImageFileType.Emf);
// Set the path of image file
img1.getImageInfo().setFile( “test.emf”);
// Set the path of image file
img1.getImageInfo().setTitle(“EMF image”);
// Save the Pdf
pdf1.save(“test.pdf”);
Hi,
I’m confused - you mean that aspose.pdf-new-4.0.0.jar doesn’t support EMF yet?
I created testing by using new APIs:
com.aspose.pdf.Document pdfDocument1 = new com.aspose.pdf.Document();
com.aspose.pdf.Page page = pdfDocument1.getPages().add();
// load image into stream
java.io.FileInputStream imageStream =
new java.io.FileInputStream(
new java.io.File(“test.emf”));
// add image to Images collection of Page Resources
page.getResources().getImages().add(imageStream);
I got the exception:
class com.aspose.ms.System.c: Invalid image stream (Error loading file: Unsupported file format Parameter name: input).
yongshao:I’m confused - you mean that aspose.pdf-new-4.0.0.jar doesn’t support EMF yet?
yongshao:
I created testing by using new APIs:
com.aspose.pdf.Document pdfDocument1 = new com.aspose.pdf.Document();
com.aspose.pdf.Page page = pdfDocument1.getPages().add();
// load image into stream
java.io.FileInputStream imageStream =
new java.io.FileInputStream(
new java.io.File(“test.emf”));
// add image to Images collection of Page Resources
page.getResources().getImages().add(imageStream);
I got the exception:
class com.aspose.ms.System.c: Invalid image stream (Error loading file: Unsupported file format Parameter name: input).
This problem has already been logged in our issue tracking system as PDFNEWJAVA-33464. We
will investigate this issue in details and will keep you updated on the status
of a correction. <o:p></o:p>
We apologize for your inconvenience.
The issues you have found earlier (filed as PDFNEWJAVA-33464) have been fixed in Aspose.Pdf for Java 9.7.1.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.