Hi Team
I am using jdk 8 with aspose pdf version 19.5. I want to insert html code into existing pdf.
Below is my sample code.
Document pdfDocument = new com.aspose.pdf.Document(“pdf file path here”);
Page pdfPage = pdfDocument.getPages().get_Item(1);
HtmlFragment htmlFragment = new HtmlFragment(“html italic tag start Deepak Gupta html italic tag end”);
FloatingBox box1 = new FloatingBox();
box1.setLeft(100);
box1.setTop(100);
box1.getParagraphs().add(htmlFragment);
pdfPage.getParagraphs().add(box1);
pdfDocument.save(“path to save updated pdf”);
Above code is taking two much to update the existing pdf.
and when I try to do the same with textfragment class . Then it is working fine
TextFragment textFragment = new TextFragment(“Deepak Gupta”);
textFragment.setPosition(new Position((double)100, 100));
TextBuilder textBuilder = new TextBuilder(pdfPage);
textBuilder.appendText(textFragment);
I am also attaching pdf file that I am using on my system. Please help me why it is taking time ?
blank_1599119324527_1599119340334.pdf (939 Bytes)