File attachments handling in attachment pane in Qoppa PDF components

Qoppa’s PDF Swing components jPDFViewer, jPDFNotes and jPDFEditor have a side tab / pane that will show all file attachments that were added to a PDF document. Handling of File Attachments When double-clicking on one of the file attachment, Qoppa’s PDF components will by default handle the documents in the following way: PDF documents will […]

Read More

Scaling your Java Application for 4K High DPI Displays support on Mac, Windows, Linux

4k support in Qoppa PDF Components In version v2017R1,  support for 4K monitors was added in Qoppa PDF components jPDFViewer, jPDFNotes and jPDFEditor. The user interface was completely revised to support 4k HiDPI Display monitors with automatic DPI scaling for all dialogs and toolbars as well as newly designed vector icons that render crisp at any resolution. Customers integrating […]

Read More

Invalid colors for CMYK images when cmykProfile.jar missing in classpath

When rendering or optimizing images with a CMYK color space (DeviceCMYK), Qoppa’s PDF libraries and components need the cmykProfile.jar to be present in the classpath. If you forget to include this jar, you will get images with “weird” colors. Faces for instance will show with more intense, bright saturated colors (such as red and blue) […]

Read More

Selecting an annotation on a page in Qoppa’s PDF components

Q: How can I select a given annotation on a page in jPDFViewer, jPDFNotes or jPDFEditor? A: You will need to work with the IAnnotationManager, which manages the selection cycle for annotations. IAnnotationManager annotmanager = viewerBean.getAnnotationManager();IAnnotationManager annotmanager = viewerBean.getAnnotationManager(); This interface manages the selection cycle for annotation components on a page and allows to programmatically […]

Read More

Deleting all bookmarks from a PDF document

To delete all bookmarks in a PDF document, simply create a new empty root bookmark. With jPDFProcess, use PDFDocument.createRootBookmark(); With jPDFAssemble, use PDFAssemble.createRootBookmark(); With jPDFEditor, use PDFEditorBean.getDocument().createRootBookmark(); Here is sample code to do so: // Load the document PDFDocument pdfDoc = new PDFDocument ("input.pdf", null); // Get the root bookmark, create one if necessary Bookmark […]

Read More

Clear Password and Permissions in a PDF document

It is possible to clear permissions and passwords in a PDF document using several of Qoppa’s Java PDF libraries and components. With jPDFSecure, use PDFSecure.clearPasswordPermissions() With jPDFProcess, use PDFDocument.clearPasswordPermissions() With jPDFEditor, use PDFEditorBean.getDocument().clearPasswordPermissions() Calling PDFSecure.clearPasswordPermissions will clear all password permissions for this document: it will reset all password permissions to true. it will clear open/user […]

Read More

Changing PDF Document Permissions and Passwords

It is possible to set / update permissions and passwords in a PDF document using several of Qoppa’s Java PDF libraries and components. Call to change document permissions and passwords depending on which Qoppa library you use:   // with jPDFSecure PDFSecure.setPasswordPermissions(newPermPwd, newOpenPwd, permissions, currentPermPwd, encryptType);   // with jPDFProcess PDFDocument.setPasswordPermissions(newPermPwd, newOpenPwd, permissions, currentPermPwd, encryptType); […]

Read More

How to Resolve Error Rendering Page: Missing Font

When rendering a PDF document in the following Qoppa’s PDF library products: jPDFImages, jPDFPrint, jPDFProcess, jPDFViewer, jPDFNotes or jPDFEditor, you might encounter a blank page with the following error displayed on a page. This happens because the PDF document is calling for a font, ‘F0’ in this case, that is not embedded in the document […]

Read More

On using Java RenderingHints to smooth jagged edges on rotated images

Q: There seems to be some pixelation or resolution issue when rendering specific images in a PDF brochure. Is there anything that can be done to render these images more smoothly? A: Qoppa’s PDF libraries and components uses our own interpolation algorithm that works much better than the built-in Java algorithm well both when up-sampling […]

Read More

Changing default magnification (fit to page, fit to width, given zoom level)

To change the initial magnification settings when opening PDF documents in Qoppa’s PDF components and ignore the magnification settings contained in the PDF document (if any), make the following method calls immediately after instantiating the PDF bean, before opening any PDF document: Set a Fit To Width Magnification: Display with the page magnified just enough […]

Read More

Customizing Annotations Tools

Q: How can I customize annotations tools in jPDFNotes? A: Use the class called AnnotationTools that manages the default properties and settings for the annotation tools in Qoppa’s PDF components. Disable Flattening of Annotations AnnotationTools.setFlatteningEnabled(false);AnnotationTools.setFlatteningEnabled(false); Disable Deleting of Annotations AnnotationTools.setDeleteEnabled(false);AnnotationTools.setDeleteEnabled(false); Set Default Author for New Annotations AnnotationTools.setDefaultAuthor("John Smith");AnnotationTools.setDefaultAuthor("John Smith");

Read More

List of Supported JavaScript Actions in Qoppa PDF Components

Here is the list of supported actions in Qoppa’s PDF Library and Component Products. The table below lists the JavaScript actions, where they live in the PDF document and if they are supported or not.   Parent Dictionary Entry Supported/Unsupported Document Level: Names (in the Catalog dictionary) JavaScript Supported Catalog OpenAction Supported AA (additional actions […]

Read More

List of Supported JavaScript Objects / Methods / Properties in Qoppa PDF Components

Here is a list of all objects, methods and properties supported in Qoppa’s PDF Library and Component Products. This list was compiled for v2016R1. App Methods: alert beep openDoc popUpMenu popUpMenuEx response setTimeOut trustedFunction Properties: formsVersion viewerType viewerVersion Color Methods: equal Properties: black blue cyan dkGray gray green ltGray magenta red transparent white yellow Console […]

Read More

New exception NoSuchMethodError “initSafeStandardObjects” when loading a PDF with JavaScript validation

Q: I upgraded to the latest version of jPDFNotes v2016R1. I am loading a PDF that has JavaScript form field validation, but I received this error: com.qoppa.pdf.PDFException: Error loading PDF org.mozilla.javascript.Context.initSafeStandardObjects(Lorg/mozilla/javascript/ScriptableObject;Z)Lorg/mozilla/javascript/ScriptableObject; java.lang.NoSuchMethodError: org.mozilla.javascript.Context.initSafeStandardObjects(Lorg/mozilla/javascript/ScriptableObject;Z)Lorg/mozilla/javascript/ScriptableObject; A: Starting in version v2016R1, Qoppa’s PDF components started using Rhino version 1.7.7.1 instead of version 1.4. We upgraded to the latest […]

Read More

How to add your own custom annotation tools in Qoppa PDF component

Q: Can I add my own custom annotation tools to Qoppa PDF component’s toolbar? A: Yes. Qoppa PDF components jPDFNotes and jPDFEditor are fully customizable including the Annotation Toolbar. You can remove any existing tools / buttons from the annotation toolbar and add your own buttons for your own tools. This applies to jPDFNotes and […]

Read More

Customizing icon sizes in Qoppa’s PDF Components

Q: Is it possible to customize the size of the icons (to make them smaller or larger) in Qoppa’s PDF components? A: Yes, Qoppa’s components ship with 4 different icons sizes: small, medium, large and extra large. Here is a sample code showing how to adjust the size of the component’s icons: // call this […]

Read More

Touch Mode in Qoppa’s PDF components for smaller / touch-enabled screens

Qoppa’s PDF viewing components (jPDFEditor, jPDFNotes, jPDFViewer) feature a Touch Mode that makes editing and annotating PDF documents more friendly on touch screen enabled laptops, PCs and tablets such as the Windows Surface Pro, Dell Venue 11, or Lenovo Yoga 3 Pro. This feature was added in v2016R1. What are the Touch Mode Features? Enlarged […]

Read More

How to add a rubber stamp with preview to the existing stamp menu

Here is Java sample code to create a menu item that will display a preview of a rubber stamp and that can added to any JMenu. The method AnnotToolbar.createStampMenuItem to create this preview menu item was added in version v2016R1 of Qoppa’s PDF components jPDFNotes and jPDFEditor. try { // Create a menu item with […]

Read More

Remove Border around Pages in Qoppa’s PDF Components

Q: Is it possible to remove the black border around pages in Qoppa’s PDF component? See screenshot below. A: Yes, it is. See code sample below. Modifying the border we use on page view components can be done with an IPDFListener after the document is opened.  Also the documentChanged() method needs to  be overwritten to modify the […]

Read More

Submit a PDF form to a service and receiving a response back

Q: How can I submit FDF, XFDF or HTML data to a server and receive a response back? A: Here is a sample service that receive a PDF file and then responds with an FDF file. package com.qoppa.jaxrs.service.test;   import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream;   import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import […]

Read More

JavaScript warnings when submitting forms or emailing documents

In v2016R1, we’re adding settings to turn off warning in JavaScript for the submitForm and mailDoc function. Turn off warning on submitform // turn off warning in submitform function // before connecting to a URL JavaScriptSettings.setSubmitFormWarn(false);// turn off warning in submitform function // before connecting to a URL JavaScriptSettings.setSubmitFormWarn(false);   Turn off warning on maildoc […]

Read More

NullPointerException in isDispatchThreadImpl when adding Swing components outside the Swing Event Thread

Q: We’re having an issue using PDFViewerBean when adding a button to the toolbar. The issue appears periodically. The code: JButton button = new JButton ("Some button"); PDFViewerBean.getSelectToolbar().add(button); button.addActionListener(someListener);JButton button = new JButton ("Some button"); PDFViewerBean.getSelectToolbar().add(button); button.addActionListener(someListener); The exception stack trace: java.lang.NullPointerException at java.awt.EventQueue$2.isDispatchThreadImpl(Unknown Source) at sun.awt.SunToolkit.isDispatchThreadForAppContext(Unknown Source) at javax.swing.JComponent.revalidate(Unknown Source) at javax.swing.JComponent.setBorder(Unknown Source) at […]

Read More

Changing the select cursor on annotation components

The sample below shows how to change the select cursor on annotations components. This done by adding a IPDFListener to the PDFNotesBean and implementing the method afterDocOpened(). In this method, the cursor of annotations components is changed to the predefined hand cursor. PDFNotesBean notesBean = new PDFNotesBean(); // !! This is important to ensure that […]

Read More

Invalid CMAP name when rendering or printing a PDF page

Q: When opening a PDF file, I get the following error: A: You are missing cmaps.jar in your classpath which contains CMaps, used to read and display character encodings used with CJK (Chinese, Japanese, Korean) content. Download cmaps.jar   This error can happen when rendering PDF documents in Qoppa’s PDF components (jPDFViewer, jPDFNotes, jPDFEditor) or […]

Read More

Getting interactive field location information (bounds and page number)

To get PDF interactive form fields location information (including signature fields) such as dimension and page number, you will need to access the widget which is the visual representation of the field on the page. When using Qoppa’s PDF components (jPDFViewer, jPDFNotes, jPDFEditor), you can get information from the editing component. // get Acroform AcroForm […]

Read More