We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Image in HTML

Hi,

I use Aspose.Slides for saving PowerPoint-presentations to HTML.
In
HtmlOptions of Slides.Export, I define the SlideImageFormat as Jpeg, so
I think, the HTML has embedded images which are saved in a separate
folder in filesystem.
But using the following code doesn´t save the
images as Jpeg. Do I something wrong?

My code for saving:
Aspose.Slides.Export.HtmlOptions so = new
Aspose.Slides.Export.HtmlOptions(); so.SlideImageFormat =
Aspose.Slides.Export.SlideImageFormat.Bitmap(1, ImageFormat.Jpeg);
so.JpegQuality = 100;
saveLocation = Path.Combine(saveFolder,
saveFileName);
pptx.Save(saveLocation,
Aspose.Slides.Export.SaveFormat.Html, so);

Hi Marc,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for sharing the sample code.

I am able to reproduce your mentioned issue after an initial test. Your issue has been registered in our issue tracking system with issue id: SLIDESNET-35171. This thread has been linked with the issue and you will get an automatic notification once the issue gets resolved.

Sorry for the inconvenience,

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


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

I have tested the fixed version, but the images for HTML-file is still missing.
Please have a look in my Visual Studio project and to the HTML-file ("\Hallo_pptx_Aspose\HTML\Hallo.html").

I can´t find the namespace Aspose.Slides.Pptx in Aspose.Slides for .NET 14.2.0.
Where is it? Should I use Aspose.Slides.Presentation only now?

Hi Marc,

Thank you for the
feedback.

Rossmanith:
I
have tested the fixed version, but the images for HTML-file is still missing.

Please have a look in my Visual Studio project and to the HTML-file
("\Hallo_pptx_Aspose\HTML\Hallo.html").

I have shared the
details and your sample application with the development team to further
investigate the issue. As soon as I get a feedback from them, I will update you
via this forum thread.

Rossmanith:


I can´t find the namespace Aspose.Slides.Pptx in Aspose.Slides for .NET 14.2.0.

Where is it? Should I use Aspose.Slides.Presentation only now?

Well, Aspose.Slides.Pptx
namespace is no longer available in new unified API of Aspose.Slides for .NET
v14.x.x. Now, you can use Aspose.Slides.Presentation to process both PPT and
PPTX files.

Thanks & Regards,

<!–[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-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-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>

Hi Marc, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please see the following details and attached solution with respect to your reported issue.

The image format options control how the images are encoded (JPEG, PNG etc). To save the images externally instead of embedding them into the HTML file needs some extra work. A class "LinkController" has been created that will be responsible for saving the files and forming the corresponding URIs. We have modified the project and attached it in the Aspose_PPT_modified.zip file. Only the Slides part left there and rest of the code is commented out. But in order to make the demonstration more clear we have created a simple console project. It is named SimpleHtmlTest and included in the attached archive. Following are some important points:

1: Using SlideImageFormat.Bitmap for HtmlOptions.SlideImageFormat means the entire slide will be saved to a bitmap thumbnail and referenced from the HTML document. That looks almost perfect when displayed in a browser but makes impossible to add hyperlinks and selectable text. We don't think this is what you need, so we used

htmlOptions.SlideImageFormat = SlideImageFormat.Svg(new SVGOptions());

SVGOptions instance allows to tune the JPG quality if necessary.

2: The output image format is not controllable by users. We choose between JPG and PNG for raster graphics based on which format produces smaller resource size (with the exception for transparency-enabled bitmaps, they are always saved to PNG because JPG does not support transparency). So we have to be ready for at least two content types in the LinkController class. If there is a desperate need to produce JPG files we could recode them in the LinkController.SaveExternal method before saving to disk.

3: If you need to get rid of slide title display when exporting to HTML, please use the following:

// The second parameter is responsible for the slide title display

htmlOptions.HtmlFormatter = HtmlFormatter.CreateDocumentFormatter(String.Empty, false);

You can try the attached solution at your end with the latest version of Aspose.Slides for .NET and let us know if it fixes your issue.

Thanks & Regards,

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


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