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

Free Support Forum - aspose.app

HTML converted to PDF presented data not as expected

Hi working with Aspose.Words to convert HTML to PDFm and it working well, but now customer sent to us new HTML document and it the styles and html tag presented not expected, wrong alignment, sizing and position

The code that we are using is:

string workingDirectory = Directory.GetCurrentDirectory();

            string newWorkingDirectory = Path.GetDirectoryName(Environment.ExpandEnvironmentVariables(this.TemplateFileName));
            if (Directory.Exists(newWorkingDirectory))
                Directory.SetCurrentDirectory(Environment.ExpandEnvironmentVariables(newWorkingDirectory));

            Document htmlDocument = new Document(documentStream, new LoadOptions()
            {
                Encoding = Encoding.GetEncoding(documentEncoding)
            });

            builder.InsertDocument(htmlDocument, ImportFormatMode.KeepSourceFormatting);

            builder.PageSetup.PageStartingNumber = 1;
            builder.PageSetup.RestartPageNumbering = true;
            builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
            builder.InsertField("PAGE", string.Empty);
            builder.Write(" " + Properties.Resource.Page);

Attached HTML file. Please help to unrsend hoe to fix problem

Thank you
Downloads.7z (32.9 KB)

This topic has been moved to the related forum: https://forum.aspose.com/t/html-converted-to-pdf-presented-data-not-as-expected/247310