Q: How can I configure the sample applets PDFWebEditor, PDFWebNotes, PDFWebViewer that Qoppa provides as samples?
A: You can configure the applets through a config.xml file by adding it to the applet parameter tag of the HTML:
Config:"config.xml"
The config.xml file can be used to customize any of our 3 sample applets PDFWebViewer, PDFWebNotes and PDFWebEditor.
See a live applet using a config.xml file. You can right-click and choose “View Page Source” to view the source of the HTML applet.
Key: XML elements in bold, XML attributes in non-bold italics.
· QConfig – Root Element
o Toolbar – Toolbar options
§ AddTextStamp – Add a button to the annotation toolbar to start a rubber stamp annotation created from text
· Icon URL to the icon to use for the button on the toolbar
· Text – The text to use in the stamp
· Color – The color of the text and border in hexadecimal, for instance #FF0000 for red
· Rotation – Flag indicating the rotation in degrees for instance 60 for 60 degrees.
· Sticky – (true | false) – Flag indicating if this tools should be sticky
· Scale – Number indicating the scale for instance 50 for 50%
§ AddImageStamp – Add a button to the annotation toolbar to start a rubber stamp annotation created from an image
· Icon – URL to the icon to use for for the button on the toolbar
· Image – URL to the image to use for the rubber stamp
· Rotation – Flag indicating the rotation in degrees for instance 60 for 60 degrees.
· Sticky – (true | false) – Flag indicating if this tools should be sticky
· Scale – Number indicating the scale for instance 50 for 50%
§ AddSeparator – Add a separator to the annotations toolbar
§ RubberStamps – Configure the Rubber Stamps drop down menu
· AddTextStamp – Add an entry to the rubber stamp drop down menu to start a rubber stamp annotation created from text
See above for options
· AddImageStamp – Add a button to the annotation toolbar to start a rubber stamp annotation created from an image
See above for options
· RemoveStamp – Remove one of the standard rubber stamps, using the rubber stamp title
o Title – The title of the rubber stamp in the default drop down menu.
· AddSeparator – Add a separator to the rubber stamp drop down menu
§ RemoveButton – Remove a button from any of the toolbars (main navigation toolbar or any sub-toolbar)
· MethodName – The name of the method in one of the annotation toolbar classes to call to get the button in the toolbar. The applet will then call that buttons setVisible() method to hide the button.
getjbAttachFile, getjbSearch, getjbPrint, getjbLoupe, getjbPanAndZoom
getjbHand, getjbSelect, getJbSnapShot
See all buttons in com.qoppa.pdfViewer.Toolbar, com.qoppa.pdfNotes.AnnotToolbar, and com.qoppa.editor.AnnotToolbarEditor…
§ HideToolbar – Hide a toolbar
· Name – (Navigation, Selection) – The name of the toolbar to hide, i.e the main navigation toolbar or the selection toolbar which has the hand, text selection and snapshot buttons
o Save – Save Options
§ SaveURL – The URL of the script to send the PDF content to when the user clicks on the Save button. This URL should point to a script that will receive a multi-part POST message with the file contents in it, for instance/scripts/upload.php for a PHP script but it could also be the URL of an ASP page, of an ASP.NET script or of a Servlet.
§ SaveFormat – (PDF | FDF | XFDF) – The format to use in saving. Use this attribute to save only the annotations to the server, instead of the full document.
§ SaveFileName – Use this name as the file name when saving the file.
§ SetCFSession – (true | false) – Set the ColdFusion session ID as part of the POST message when saving a file back to the server.
If this variable is set to true, then the HTML should include two parameters:
CFID – The ColdFusion session ID
CFTOKEN – The ColdFusion Token
§ SetJavaSession – (true | false) – Set the Java session ID as part of the POST message when saving a file back to the server.
If this variable is set to true, then the HTML should include an additional parameter:
JSESSIONID – The Java session ID.
o Key – Set the key. The contents of this element will be used to call the setKey() method in the PDFNotesBean.
o Open – Open files on startup
§ PDFURL – URL to the PDF document to load.
· MergeFDF – URL to an FDF file to merge into the PDF at load time.
· LockAnnotations – If present, lock the current annotations so that they cannot be modified.
o Notes – Notes options
§ NewNotesLayer – If present, jPDFNotes will create a new layer and insert all new annotations into this layer.
· LayerName – Name of the new layer.
§ SaveNewOnly – If present, jPDFNotes will only save new annotations when saving the document.
§ EnableLayerExport – If present, jPDFNotes will display an “Export Layer” menu when the user right clicks on a layer in the layer list.
· ExportURL – The URL to send the annotation information when a layer is exported.
Email us if you need help setting up your config.xml file.