Convert pptx with an image to pdf

Using aspose.slides-7.5.1.jar and

$ java -version
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing

I converted the attached sample.pptx to sample.pdf using the following java code:

PresentationEx ppt = new PresentationEx( pptFile.getAbsolutePath() );

ppt.save( fn, SaveFormat.Pdf );

As you can see the image in the pdf document is corrupted.

How can this be fixed so that the image in the generated PDF has the same quality as the image in the PPTX file?

Hi Bob,

Thanks for your interest in Aspose.Slides.

I have worked with the presentation file and generated PDF using JDK 1.6_45 in Windows 7 environment. The PDF generated on my end is fine and is attached for your kind reference. However, I have created an issue with ID SLIDESJAVA-34018 to further investigate and resolve the issue of improperly rendered PDF in Java Hotspot environment. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

<span style=“font-size:10.0pt;line-height:115%;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;color:black;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>

We are sorry for your inconvenience,<!–[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>
<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]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–>

Thank you. I have verified that the pdf you generated is correct. Is there a way I can modify my code to get the same results? How do I access the issue SLIDESJAVA-34018? I do not have an account for JIRA and do not know how to contact the JIRA administrators.

Hi Bob,


I regret to share that at present there is no oher workaround that I may offer to you other than using Windows 7 environment which worked on my end with given specification. Secondly, the access to Jira is internal and only permitted to Aspose staff and our worthy customers have no access to it. However, you can view the state of issue as Blocked or resolve from the very first post of this thread where by the issue is attached to this thread.

Many Thanks,

Mudassir,

Can you tell me what the issue with Java Hot Spot is? Is this a known issue? Are you able to duplicate this or are other customers able to duplicate this?

Bob

Hi Bob,


I regret to share that the issue is under investigation and I may not be able to share the cause of incurring issue unless it investigation is completed by our development team and response is shared. I will share the feedback with you as soon as the issue will be shared.

Many Thanks,

I have windows 7 ultimate SP 1, 64 bit and I still get the bad image in the PDF. Why is that?

I have a customer that is not happy and need a resolution ASAP.

<span style=“font-size:10.0pt;line-height:115%;font-family:“Arial”,“sans-serif””>this
link
<span style=“font-size:10.0pt;line-height:115%;
font-family:“Arial”,“sans-serif”;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:
AR-SA”> as well. Please share the generated Windows 7 based PDF with us along
with issue incurring and I will investigate that further.



Many Thanks,<!–[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:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<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]–><!–[if gte mso 10]> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>

It is the same as before. Here it is again. As you can see the image is doubled and blurred.

The pdf conversion works in the following environment:

Host Operating System is Windows Server 2008, version 6.0 build 6002 Service Pack 2
Java version = 1.6.0, Java Compiler = j9jit24, Java VM name = IBM J9 VM


But not in:

Windows 7 Ultimate SP1
Java\jdk1.6.0_43

Is there any explanation for this?

Hi Bob,

I have observed your comments and you have shared that you are not having issue in Windows Server 2008. But you are getting issue in Windows 7 SP1 environment. I also have the same environment as you have and have observed no issue on my end. For your kind reference the image is attached highlighting my system information, generated PDF and JDK version. I have used following sample code on my end with Aspose.Slides for Java 7.5.1. I would suggest you to please try generating PDF on some other Windows machine as I am unable to reproduce it on my end.

public static void genPptxPdf(String fileName, String path)
{
PresentationEx pres=new PresentationEx(path+fileName);
pres.save(path+fileName+".pdf",com.aspose.slides.SaveFormat.Pdf);
}

Many Thanks,

The issues you have found earlier (filed as SLIDESJAVA-34018) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.