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

Free Support Forum - aspose.com

HtmlFragment after reopen Aspose.Pdf.Document

Hi,


with this c# code
private static void PDF()
{
string fn = “d:\test.pdf”;
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document();
{
Page page = pdfDocument.Pages.Add();

HtmlFragment htmlFragment = new HtmlFragment(getHTML());
page.Paragraphs.Add(htmlFragment);
pdfDocument.ProcessParagraphs();
}

pdfDocument.Save(fn);

pdfDocument = null; //force to reopen the pdf

if (pdfDocument == null)
pdfDocument = File.Exists(fn) ? new Aspose.Pdf.Document(fn) : new Aspose.Pdf.Document();
{
Page page = pdfDocument.Pages[pdfDocument.Pages.Count];

HtmlFragment htmlFragment = new HtmlFragment(getHTML());
//if the pdfDocument is reopen this Paragraph is over the first ;
//if we use the same pdfDocument this Paragraph is after the first
page.Paragraphs.Add(htmlFragment);
pdfDocument.ProcessParagraphs();
}

pdfDocument.Save(fn);
}

I try to add a HTML paragraph after others HTML paragraphs in a reopen pdf document
and the text is put on top of page not after last paragraph of page and the text overlaying other texts

What can I do to add the HtmlFragment after last text of page in case the PDF is reopen.

thank you
Ciprian

Hi Ciprian,


Thanks for your inquriy. I have tested the scenario and noticed the reported issue, so logged a ticket PDFNET-41545 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

We are sorry for the inconvenience.

Best Regards,

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