I’m currently building something on the aspose.pdf convert to html functionality.
I’m using (among others) CssClassNamesPrefix on the HtmlSaveOptions object.
almost every css class is now automatically prefixed… except one: .view.
and precisely that one is interfering with the Html/CSS framework in which I’m showing the output-html (I’m also using HtmlMarkupGenerationModes.WriteOnlyBodyContent and adding the Html in some other page with existing html/css, hence the issue)
Is this a bug? Could this be fixed? Is there a workaround to change this during export?
Hope to hear from you.
Thanks for the quick reply. My code is as follows:
// Source PDF file
var doc = new Aspose.Pdf.Document(@“C:\path\to\file.pdf”);
// Create HtmlSaveOption with tested feature
var saveOptions = new Aspose.Pdf.HtmlSaveOptions(HtmlDocumentType.Html5, true)
SplitIntoPages = false,
RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground,
LettersPositioningMethod = HtmlSaveOptions.LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss,
CssClassNamesPrefix = “prefixedcssclass_”,
HtmlMarkupGenerationMode = HtmlSaveOptions.HtmlMarkupGenerationModes.WriteAllHtml,
PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedAllIntoHtml,
var outFile = @“C:\path\to\file.html”;
// Save the output in HTML format
If you open the Html exported it will show all the css classes prefixed with ‘prefixedcssclass_’ Except "view"
Note: It doesn’t matter if I embed the css or not.
By the way: I installed Aspose.pdf through Nuget Package manager. Version 10.1.0
Just for testing purposes I now downloaded 10.3 and installed that.
It doesn’t make a difference.
Thanks for sharing your source code. I have tested the scenario with Aspose.Pdf for .NET 10.3.0 and managed to observe the reported issue. For further investigation, I have logged an issue in our issue tracking system as PDFNEWNET-38611 and also linked your request to it. We will keep you updated via this thread regarding the issue status.
Please feel free to contact us for any further assistance.