Skip to main content
Participating Frequently
March 23, 2023
Question

vb.net to highlight PDF without editing the contents

  • March 23, 2023
  • 2 replies
  • 1658 views

When working with developing applications using vb.net to highlight pdf , I tried Adobe Acrobat SDK . 

I found out that there are two ways which I could highlight pdf. I could either copy my document to another document and highlight that document (using Page.CreatePageHilite, non-javascript) OR I could manipulate using javascript objects.

 

My priority is to preserve the integrity of the contents of the PDF i.e. ensure that the contents in the PDF are none editable but could be highlighted only. 

 

May I check with you all which  method is preferable - using javascript OR using the copy method and highlighting on the copied version (using Page.CreatePageHilite) (non-javascript).

 

Thank you very much for the help. 

This topic has been closed for replies.

2 replies

Legend
March 24, 2023

Createpagehite doesn't edit the PDF. It is equivalent to selecting text. It doesn't save with the document, and disappears if the user selects text. Is that what you want? Despite the "hilite" name it is not what I normally think of as a highlight. In PDF, highlights are actual marks, which edit the file, and are saved with it. 

hts123Author
Participating Frequently
March 24, 2023

I want to highlight and make actual marks on the PDF File. Is it possible to do it without javascript objects? I read the acrobat adobe sdk documentation and they provided a code for highlighting using C#/C++ (I guess from the code syntax). Is it possible to do it using visual basic? Thanks for the reply. 

Thom Parker
Community Expert
Community Expert
March 25, 2023

Sounds like you'll need a Highlight annotation, which is saved with the PDF. To do this the VB script will need to use the JSO(JavaScript Object) to perform this task in JavaScript.

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Thom Parker
Community Expert
Community Expert
March 23, 2023

It makes no difference at all to the PDF.  However, the JS/VB boundary is an extra layer. It's adds inefficiency  and can be problematic, so if you don't need to use JS, then don't. 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often