How to print only notes of the document?

43 views
Skip to first unread message

Sagar Fargade

unread,
Mar 5, 2018, 12:59:16 PM3/5/18
to PDFTron WebViewer
I want to print the notes as: 


The first case will be in below format
      Name of document
       <Page no> Notes for that page. 

The Second case will be: 
  The document pages.
  And then with a new page, after the end of document, notes like first case.

Matt Parizeau

unread,
Mar 6, 2018, 3:50:25 PM3/6/18
to PDFTron WebViewer
Hi,

Please refer to this post for information on how to customize the printing to display notes: https://groups.google.com/forum/#!msg/pdfnet-webviewer/Hnw7-Wh1Tc4/JR1E8lhcvPsJ

Matt Parizeau
Software Developer
PDFTron Systems Inc.
Message has been deleted

Sagar Fargade

unread,
Mar 9, 2018, 12:55:18 PM3/9/18
to PDFTron WebViewer
Hi Matt, 

I referred the post it worked.. Thanks. But how to update the page count on the print dialog after adding notes to print? 

Matt Parizeau

unread,
Mar 13, 2018, 3:06:27 PM3/13/18
to PDFTron WebViewer
You can calculate the extra pages by iterating over the list of annotations and getting the set of unique page numbers that have annotations on them and are also being printed. In ReaderControl.js you can find the "updatePrintDialog" function which updates the UI. For example:

function updatePrintDialog() {
  printPageNumbers
= getPageNumbersToPrint();

 
var pagesWithAnnotations = me.docViewer.getAnnotationManager().getAnnotationsList().filter(function(annot) {
   
return annot.Listable && printPageNumbers.indexOf(annot.PageNumber) !== -1;
 
}).map(function(annot) {
   
return annot.PageNumber;
 
});

 
var extraPages = _.uniq(pagesWithAnnotations).length;

  $
('.numberPagesLabel').attr('data-i18n', 'print.totalPageCount')
   
.data('i18n-options', {
     
'count': printPageNumbers.length + extraPages
   
})
   
.i18n();

  updatePrintButton
(printPageNumbers.length);
}

Matt Parizeau
Software Developer
PDFTron Systems Inc.


Reply all
Reply to author
Forward
0 new messages