Allow comments in PDF

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v7)  /  Allow comments in PDF

DynamicPDF CoreSuite for .NET (v7) Forum

 Mar 07 2014 3:20 AM
Is there a way to allow a user to add comments(sticky note, highlight text) to a PDF?  I found the Security class which has different flags that can be set, but none of them seem to allow comments.  I currently have a dynamic pdf generator for .Net v7.x
 Mar 07 2014 9:11 AM
Posted by a ceTe Software moderator
Hello,

You can add notes to the PDF document using Note page element of our DynamicPDF Generator product. Please refer to the documentation on Note page element here and below is the sample code for it. It is not possible to highlight the text using DynamicPDF Generator API.

            // Create a PDF Document
            Document document = new Document();
            // Create a Page and add it to the document
            Page page = new Page();
            document.Pages.Add(page);
            // Create a note
            Note note = new Note("This is my help note.", 50, 50, 150, 50,NoteType.Help, true);
            // Change the color property
            note.Color = RgbColor.Red;
            // Add the note to the page
            page.Elements.Add(note);
            page.Elements.Add(new Label("Click on the above icon to view " +"the note.", 50, 80, 150, 72, Font.HelveticaBold, 18));
            // Save the PDF
            document.Draw(@"C:\MyDocument.pdf");

Thanks,
ceTe Software Support Team.
 Mar 10 2014 11:50 PM
Once we generate the pdf and open it in toolbar of pdf there is Comment section which consist add sticky note and highlight text buttons.
But when i generate the pdf these buttons are disable in pdf i want to enable these buttons how can i do it through code or is there any other way to do it.
 Mar 11 2014 10:12 AM
Posted by a ceTe Software moderator
Hello,

We did testing on our end and still see the comment and highlight text buttons are enabled in the Reader after opening the PDF generated using the above posted code. If you are creating PDFs without setting any security then by default the highlight text and comment toolbar buttons will be enabled in the PDF Reader.

If you are setting security to the PDF and using AllowUpdateAnnotsAndFields Boolean property of the Security class then please make sure that you are setting it to true. This property controls the disabling and enabling the comment and highlight text bar buttons.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 2:29 AM.