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

Free Support Forum - aspose.com

Convert PDF to HTML using Aspose.PDF for .NET - bold text is blur on iOS (double text overlay offset)

HTML files created with Aspose.pdf .net from a pdf file do not display properly on iOS devices. Attached is a sample pdf and the resulting html (in the zipped file). Problem seems to be related to a Zoom factor. At normal zoom the overlap is so bad the text is unreadable. At higher zoom factors the overlap is barely noticeable. Problem only appears to be when the html is displayed on iOS devices. The same file displays properly on OS X Safari, Windows Chrome, Firefox, and IE, Android native and Chrome.

Document doc = new Document("C:\Somefile.pdf");
// Instantiate HTML Save options object
HtmlSaveOptions newOptions = new HtmlSaveOptions();

// Enable option to embed all resources inside the HTML
newOptions.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedAllIntoHtml;
newOptions.SplitIntoPages = false;
newOptions.LettersPositioningMethod = HtmlSaveOptions.LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss;
newOptions.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;
newOptions.FontSavingMode = HtmlSaveOptions.FontSavingModes.SaveInAllFormats;
newOptions.CustomHtmlSavingStrategy = new HtmlSaveOptions.HtmlPageMarkupSavingStrategy((HtmlSaveOptions.HtmlPageMarkupSavingInfo htmlSavingInfo) =>
result.Content = new StreamContent(htmlSavingInfo.ContentStream);
result.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html");
doc.Save(@"z:\dummy\path.html", newOptions);

Hi Mark,

Thank for your inquiry. We are looking into the issue and will update you soon.

We are sorry for the inconvenience caused.

Best Regards,

Hi Mark,

I have tested the scenario using Aspose.Pdf for .NET 11.2.0 in Visual Studio 2015 running over Windows 8.1, where I have used the same code snippet as shared in earlier post (except I have commented out code inside CustomHtmlSavingStrategy overload, because result object is not defined and as per my observations, when viewing the file in iOS 9.2.1, I am unable to notice any issue.

For your reference, I have also attached the output HTML and snapshot showing HTML preview on iOS. Can you please share the version of API you are using and also some details regarding your working environment. We are sorry for this inconvenience.
The file you created is still showing the double bold text in Safari on an iPhone 4S iOS 9.2 (see attached for actual screen shot) and an iPad 2 iOS 9.2. It can also be seen using Safari on the iOS emulator. Our actual problem is with the webview in Cordova, but the same problem happens in Safari.

The work around we are currently using for iOS devices is to remove "font-weight: bold;" from all elements with a style attribute. Since the font itself is bold, the document still appears correctly without the double lettering.

Hi Mark,

Thanks for sharing the details.

I have again tested the scenario and have managed to reproduce that same problem that text appears twice when viewing the file in Safari browser. However when using default application view client when accessing the file from email client, no such issue occurs. For the sake of correction, I have logged this problem
as PDFNEWNET-40179 in our issue tracking system. We will
further look into the details of this problem and will keep you updated on the
status of correction. Please be patient and spare us little time. We are sorry
for this inconvenience.

Any update on this issue. Its still happening in iPad and iPhone.

Hi Rakesh,

Thanks for your inquiry. I am afraid above reported issue is still not resolved as product team is busy in resolving other issue in the queue. However, we have requested our product team to complete the investigation and share an ETA/update. We will notify you as soon as we made some significant progress towards issue resolution.

We are sorry for the inconvenience.

Best Regards,

The issues you have found earlier (filed as PDFNET-40179) have been fixed in Aspose.PDF for .NET 20.6.