How do I add new annotation status for annotation menu poppup

Hello Team,

I want to add new item to the annotation popup menu f
or annotation status update.
Please help me how to do this.


Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


Hello Vijaykumar,

We have documentation on setting custom states here:

We would like to implement a better solution for this and it is in our backlog. We don’t have a timeline for when it will be available, but if it does get worked on we’ll let you know.

Best Regards,
Tyler Gordon
Web Development Support Engineer
PDFTron Systems, Inc.

Thank you for your reply.
I will wait until this implementation is done from pdftron side.

I need one more help,
I want to format annotation date and time in MMM DD, YYYY, HH:MM AM/PM format.
Below screenshot shows date and time in this format currently in PDFTron Webviewer.

Thank you

Hello Vijaykumar,

We have an API that allows you to set the format for the Note, for example:

instance.UI.setNoteDateFormat('DD.MM.YYYY HH:MM');

You can read more here: PDFTron WebViewer Class: WebViewerInstance

Best Regards,
Tyler Gordon
Web Development Support Engineer
PDFTron Systems, Inc.

Hello Team,

I am really very happy for the quick response, and this will help us a lot.

Thank you

Hello Team,

I need one more Help related to PDFNet library outside of PDFTron Webviewer. We have not yet purchased liscence.
My requirement is to download document present in my local system by merging annotation string into new document. Here below is my code
Promise.all([loadScript(this, PDfTronlibUrl + “/core/pdf/PDFNet.js”)])
.then(() => {
let xfdfdatastring = <?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="" xml:space="preserve"><pdf-info xmlns="" version="2" import-version="3" /><fields /><annots><text color="#FFFF00" creationdate="D:20210913170635+05'30'" flags="print,nozoom,norotate" inreplyto="91d19039-7ed7-daa1-c5f2-f81a6b1e4348" date="D:20210913170635+05'30'" name="e4f38e28-3a0e-d217-1fc9-fb51d9959267" icon="Comment" page="0" rect="108.35,565.69,128.35,585.69" statemodel="Review" subject="Note" title="Guest">\n\t\t\t<trn-custom-data bytes="{&quot;trn-mention&quot;:&quot;{\&quot;contents\&quot;:\&quot;sdfsdfsdf\&quot;,\&quot;ids\&quot;:[]}&quot;}"/>\n\t\t\t<contents>sdfsdfsdf</contents>\n\t\t\t<apref y="585.69" x="108.35" gennum="0" objnum="727"/>\n\t\t</text><link page="1" rect="171.239,457.557,258.822,470.961" name="3763a5790841862f-c0152a0cade8c17b" width="0" style="solid"><apref gennum="0" objnum="120" x="171.239" y="470.961"/><OnActivation><Action Trigger="U"><URI Name=""/></Action></OnActivation></link><link page="1" rect="149.592,305.545,261.516,318.949" name="3763a57a08418630-c0152a0bade8c17a" width="0" style="solid"><apref gennum="0" objnum="121" x="149.592" y="318.949"/><OnActivation><Action Trigger="U"><URI Name=""/></Action></OnActivation></link><link page="1" rect="265.162,286.541,428.274,299.945" name="3763a57b08418631-c0152a0aade8c179" width="0" style="solid"><apref gennum="0" objnum="122" x="265.162" y="299.945"/><OnActivation><Action Trigger="U"><URI Name=""/></Action></OnActivation></link><square page="0" rect="364.5,583.34,499.57,706.29" color="#4E7DE9" flags="print" name="647eed3a-5b09-e3f2-bbe0-73bc6157387d" title="User User" subject="Rectangle" date="D:20211005131331+05'30'" creationdate="D:20211005131331+05'30'"/></annots><pages><defmtx matrix="1,0,0,-1,0,792" /></pages></xfdf>;
const fdf_doc = PDFNet.FDFDoc.createFromXFDF(xfdfdatastring);
const doc = PDFNet.PDFDoc.createFromURL(“http://localhost/Web4.5/TOCtypes.pdf”);
const buf = doc.saveMemoryBuffer(PDFNet.SDFDoc.SaveOptions.e_linearized);
const blob = new Blob([buf], { type: “application/pdf” });
window.saveAs(blob, “newdoc.pdf”);

Here i am getting an error if i am use any methods/API present in PDFNet library. Error shown in the image.

Please help me on this to resolve this issue.

Thanks Vijaykumar L S

Hello Vijaykumar,

We have a handy guide here on merging XFDF into PDF documents:

Let us know if this works for you!

Best Regards,
Tyler Gordon
Web Development Support Engineer
PDFTron Systems, Inc.

Hi Gordon,

Same issue I am facing.
I have tried with link which you have given.

Its work perfectly when the PDFTron.WebViewer is initialize able to download the pdf with annotation.

But When I tried to merge the pdf and annotation with out initializing PDFTron.WebViewer it wont work.

These are the use case which I am trying to implement in our application.
Without loading the PDFTron.WebViewer
I need to download the pdf with
→ PDF with Annotations
→ Only PDF (Without Annotations )

This is the error I am getting

Please help me out to resolve this

Hello vinaymuthanna0727,

Welcome to the PDFTron Community!
Here’s a guide on using the Full API without WebViewer:

Let me know if this works for you!

Best Regards,
Tyler Gordon
Web Development Support Engineer
PDFTron Systems, Inc.

Hi gordon,

Thank you for the reply.

Facing multiple issue on integrating into the sales force.
Can you please provide steps to integrate the download pdf running without viewer into sales force application?

Thanks in advance.

Hello vinaymuthanna0727

We have guides on implementing WebViewer in Salesforce here:

Best Regards,
Tyler Gordon
Web Development Support Engineer
PDFTron Systems, Inc.

Hi gordon,

The above guide / link which you have provided is related to the implementing WebViewer in Salesforce .
We have already implemented the WebViewer in our Salesforce Application.

The problem/Issue I am facing in our Salesforce Application is to Implement the Download PDF with Annotation without using WebViewer.

Can you please provide me the info/steps to Implement the Download PDF with Annotation in Salesforce Application with Full API without using WebViewer?

Because the requirement is to download the PDF with Annotation with out loading the WebViewer.

Please help me out to resolve this


I wanted to answer your question of how to save pdf with XFDF string included in PDF without using WebViewer UI.
Related APIs you need to use: Core.createDocument for loading PDF from URL, doc.getFileData for merging XFDF and creating PDF in raw format.

Here is an example:

This example file shows how to load core-controls

    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
    <script src='../../../lib/samples/FileSaver.min.js'></script>
  <body style='padding: 0; margin: 0'>

    <script src="../../../lib/core/webviewer-core.min.js"></script>
    <script src='./index.js'></script>

The main JS file


const xfdfString = `<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="" xml:space="preserve"><pdf-info xmlns="" version="2" import-version="4" /><fields /><annots><square page="0" rect="138.180,570.180,413.330,695.030" color="#E44234" flags="print" name="8ad6ceb1-aed3-726c-4862-14e42b33a219" title="Guest" subject="Rectangle" date="D:20220118114254-08'00'" creationdate="D:20220118114254-08'00'"/></annots><pages><defmtx matrix="1,0,0,-1,0,792" /></pages></xfdf>`

Core.createDocument('/blank.pdf').then(async (doc) => {
  const data = await doc.getFileData({
    // saves the document with annotations in it
  const arr = new Uint8Array(data);
  const blob = new Blob([arr], { type: 'application/pdf' });
  saveAs(blob, 'output.pdf');
}).catch(error => {