Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Oct 11, 2019 11:03 am

HI Spire Support,

need help regarding replacing bookmark html code, please see below sample:

"<table width=\"1451\">\r\n<tbody>\r\n<tr>\r\n<td width=\"75\">5901</td>\r\n<td width=\"1376\">Raw Materials (RMSS-191309) - Display FOR Approval upon submission of ADMIN account instead of APPROVED</td>\r\n</tr>\r\n<tr>\r\n<td>5902</td>\r\n<td>Raw Materials (RMSS-191309) - Was not able to save as DRAFT with SQL injection on the fields using ADMIN account</td>\r\n</tr>\r\n<tr>\r\n<td>5903</td>\r\n<td>Raw Materials (RMSS-191309) - Display \"No file(s) File(s) doesn't exist. Please contact your administrator.\"&nbsp; upon viewing attached file</td>\r\n</tr>\r\n<tr>\r\n<td>5924</td>\r\n<td>Raw Materials (RMSS-191315) - Instead of Automatically Approved Status it display FOR APPROVAL using Admin account</td>\r\n</tr>\r\n</tbody>\r\n</table>"

I have attached my code for your reference, hope to hear from you soon.

tcballelos
 
Posts: 36
Joined: Wed Nov 28, 2018 5:35 am

Sat Oct 12, 2019 10:56 am

Hi,

Thanks for your inquiry.
Note the paragraph doesn't include table, they are same level. The code you used is incorrect. Please delete the bookmark content first then insert the table into the bookmark. Below is the code for your reference.

Code: Select all
            Section tempSection = document.AddSection();
            String html = "your Html";
           
            tempSection.AddParagraph().AppendHTML(html);

            //Get the table
            Table table = tempSection.Tables[0] as Table;

            BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);

            //Locate the bookmark
            bookmarkNavigator.MoveToBookmark("bookmark2");

            //Delete the bookmark content
            bookmarkNavigator.DeleteBookmarkContent(true);

            //Insert the table into the bookmark
            bookmarkNavigator.InsertTable(table);


If the code couldn't solve your issue, to help us better investigate it, please offer us your input Word file(if any) and your desired result file. You could upload them here or send us([email protected]) via email.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Tue Oct 15, 2019 2:37 am

Thank you so much! it is already working

tcballelos
 
Posts: 36
Joined: Wed Nov 28, 2018 5:35 am

Tue Oct 15, 2019 3:30 am

Hi,

Thanks for your feedback.
Any question, welcome to contact us. Have a nice day.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.PDF

cron