Image issue: PDF or Word to EML or MSG

Test_fa5_Final_Ver2_202401110442OOBL.zip (218.7 KB)

Hi.
Aspose.Email version 23.12.0
i want to convert PDF (with redaction) to eml/msg. i convert PDF to html and html to eml or msg.
html show correct image location, but after convert to eml or msg all redaction boxes and image are combined to one and separated with text (image to top and text to bottom)

this is my code
Aspose.Email.MailMessage Originalmessage = Aspose.Email.MailMessage.Load(OriginalEmailFilePath);
//PDF to Html
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(SourcePDFFilePath);
string OutPutFilePathHtml = Path.Combine(FileDirectory, OutputFileName + “.html”);
{
Aspose.Pdf.HtmlSaveOptions HtmlSaveoption = new Aspose.Pdf.HtmlSaveOptions()
{
//ConvertMarkedContentToLayers= false,
//CompressSvgGraphicsIfAny = true,
//FlowLayoutParagraphFullWidth = true,
//UseZOrder = true,

                            RasterImagesSavingMode = Aspose.Pdf.HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground,
                            PartsEmbeddingMode = Aspose.Pdf.HtmlSaveOptions.PartsEmbeddingModes.EmbedAllIntoHtml,
                        };

                        pdfDocument.Save(OutPutFilePathHtml, HtmlSaveoption);
                    }

//Html to Email
ResultMessage.SetHtmlBody(File.ReadAllText(OutPutFilePathHtml), true);
ResultMessage.Save(TargetFilePath, Aspose.Email.SaveOptions.DefaultMsg);

Test_fa5_Final_Ver2_202401110442OOBL.pdf (52.7 KB)

Thank you

Hello @jpark1980 ,

Thank you for reporting your case.

We’ll investigate the issue and come back with a possible solution.

@jpark1980,

In your case, the source HTML contains “div” tags.
Unfortinately, when it comes to HTML emails, the use of <div> tags can be somewhat problematic due to compatibility issues with different email clients.
While browsers are consistent in how they handle <div> tags and associated CSS, email clients can vary significantly. Some email clients, particularly desktop clients like Outlook, may not render <div> tags or their styles as expected.
It’s important to note that the body of an HTML email must be carefully crafted with inline CSS and table-based layouts to ensure consistency across all email clients.

Hi Margarita,

the HTML file is Aspose (converted from pdf to html).
I tried to convert the pdf file to HTML from Adobe.
the HTML file from Adobe contains <span> instead of <div> and it looks much better than before.

do Aspose have the same behavior with Adobe in conversion from PDF to HTML? if it is, please let me know.

i attached two files for comparison.
HTML files.zip (57.5 KB)

@jpark1980 ,

The conversion from PDF to HTML is outside Aspose.Email scope. Please contact Aspose.PDF to get the answer to your question.