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

Free Support Forum - aspose.com

Replicate Word Bookmark in Aspose PDF

Hi,

I am trying to insert a value at a certain position in the PDF file using ASPOSE PDF API. However I do not see any functionality with respect to that.

Please advise how can some predefined text be displayed on a certain position like using a Word Bookmark in PDF.



I have tried using the below code to set Bookmark values but no values are displayed on the PDF file.



PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(new Document());



Bookmarks bookmarks= bookmarkEditor.extractBookmarks();





for(com.aspose.pdf.facades.Bookmark bookmark: (Iterable) bookmarks){

String strLevelSeprator = “”;

for (int i = 1; i
{

strLevelSeprator += "---- ";

}

System.out.println(“Action…”+bookmark.getAction());

bookmark.setAction(“testing value”);

bookmark.setPageDisplay(“testing…xyz”);



System.out.println("Title :- " + strLevelSeprator + bookmark.getTitle());

System.out.println("Page Number :- " + strLevelSeprator + bookmark.getPageNumber());

System.out.println("Page Action :- " + strLevelSeprator + bookmark.getAction());

}



Please advise urgently. Thanks.

Hi Helena,


Thanks for contacting support.

In case you need to add text inside PDF file, then please follow the instructions specified over Add Text to a PDF file.

The above code snippet is extracting existing bookmarks from PDF file and retrieving Title, PageNumber and Page Action information. In case you still face any issue, please share the input PDF file, so that we can further look into this matter.

Thanks, I shall try this option. However, I was looking out for a convenient option for the users to add the position themselves on the page which can be easily managed.
Is there some other option other than hardcoding the position ourselves at the code level rather than user level.

Please advise.

Hi,
I believe I have Priority Support. However I am unable to access the Priority Support forum. It suggests that there are Permission issues.
Can you please look into this and let me know.

Thanks

helena.wing:
Thanks, I shall try this option. However, I was looking out for a convenient option for the users to add the position themselves on the page which can be easily managed.
Is there some other option other than hardcoding the position ourselves at the code level rather than user level.

Please advise.

Hi Helena,


Thanks for sharing the details.

You can specify the coordinates for TextFragment object on runtime and Text will be rendered accordingly. However in order to display the preview of document, you may consider Converting PDF Page to Image and render the image in browser/pane. The user can specify the location where they want to add the text and then use similar position to add TextFragment. Once the operation is completed, you may again convert the pages to Image format and then display the preview to users.

Please note that the PDF page height and width properties use point as the basic unit, where 1 inch = 72 points and 1 cm = 1/2.54 inch = 0.3937 inch = 28.3 points.
helena.wing:
Hi, I believe I have Priority Support. However I am unable to access the Priority Support forum. It suggests that there are Permission issues. Can you please look into this and let me know.

Thanks

Hi Helena,

The issue has been communicated to respective team and they are further looking into this matter. As soon as we have some further updates, we will let you know. We are sorry for this inconvenience.

Thanks. I believe this a very cumbersome process of dynamically adding the position.
I am intending to add dynamic tables at a certain position on the page. Is that possible?
Is dynamic table creation possible in Aspose PDF?
Please advise.

Hi Helena,


Thanks for contacting support.

Aspose.Pdf for Java supports the feature to Add Table in Existing PDF Document. You can use these instructions to dynamically add tables existing PDF files.

Now concerning to the issue regarding access to Priority Support forum, and as per our records, your user does not have Priority Support subscription and have a license for Aspose.Pdf for Java Developer OEM model.