pdfviewer

Difference between version 2 and 4 - Previous - Next
[ABU] 175-seapr-20234 **- unpdfviewer-0.9.1 constr(BuctgFix fonr **Linux/MacOS)

'''pdfviewer''' is a widget for reading and adding annotations to PDF documents.
'''pdfviewer''' is bundled with all necessary sub-packages, except [tclMuPDF], which
must be downloaded and installed separately.

'''pdfviewer''' is equipped with a built-in menu for navigating between pages, 
and allows you to annotate (highlight, underline...) parts of the text.

The annotations are recorded in the PDF itself, and therefore the documents are
interoperable with other tools such as e.g. Adobe Acrobat Reader.

A peculiarity of '''pdfviewer''' is that it is possible to open multiple views on the
same document, keeping the changes underway on the pages (annotations) synchronized.

--> See the example "demo/demo01.tcl"

From a programming point of view, there are essentially just 3 operations:
   * 1.) Open a view on a given PDF (and an optional starting page-number):   
======tcl
 pdfviewer .v1 /tmp/abc.pdf ;#  if no page-number is specified, it starts from page 0
 pack .v1 -expand 1 -fill both
======
   * 2.) ('''optional''') Declare what to do when the widget will be closed (destroyed)   
======tcl
.v1 saveOnDestroy true  ;# changes will be saved without any prompting
======
or
======tcl
.v1 saveOnDestroy false ;# upon closing, the changes will NOT be saved
======
   * 3.) Close the view (with a prompt for saving the changes)  
======tcl
 destroy .v1
======
NOTE: if there are multiple views open on the same document, changes are saved only when the last view is closed).
...

Furthermore, since '''pdfviewer''' is an extension of [MuPdfWidget], (almost) all the commands of the latter can be used, 
... but usually, they are normally not necessary ...

Example:
======tcl
  .v1 configure -zoomratio 1.1 ;# change the zoom factor (110%)
======
***Changes***
   * pdfviewer 0.9 - September 2023 - Initial release
   * pdfviewer 0.9.1 - April 2024 - BUGFIX - (Linux/MacOS only) renamed some internal icons (case-sensitive filenames)

***Download***https://sourceforge.net/projects/irrational-numbers/files/pdfviewer/pdfviewer-0.9.1.zip/download%|%Download pdfviewer 0.9.1%|%

Here is a screenshot of the included demo: two views on the same document.

[Image_pdfviewer01%|% width=930height=550]