Skip to main content
Participating Frequently
Mar 23, 2023 1:07 PM UTC
Question

vb.net to highlight PDF without editing the contents

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 is closed to new replies. Start a new post to keep the conversation going.

10 replies

Legend
Mar 24, 2023 7:25 PM UTC

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. 

Translate
hts123Author
Participating Frequently
Mar 24, 2023 8:37 PM UTC

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. 

Translate
Thom Parker
Community Expert
Community Expert
Mar 25, 2023 1:52 AM UTC

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.

 

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Thom Parker
Community Expert
Community Expert
Mar 23, 2023 4:44 PM UTC

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. 

 

 

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