GroupDocs.Viewer for Java 19.11 Release Notes

Major Features

There are 20 features, improvements and a bug-fixes in this release, the most notable are:

  • Added Zipped File (.zip) file format support
  • Added Consolidated Unix File Archive (.tar) file format support
  • Added support of rendering PDF documents with security settings

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
VIEWERJAVA-1983Add zip file format supportFeature
VIEWERJAVA-1984Add tar file format supportFeature
VIEWERJAVA-1996Obtaining list of folders contained in the zip archiveFeature
VIEWERJAVA-1997Add C# (.cs) file format supportFeature
VIEWERJAVA-1998Add Visual Basic (.vb) file format supportFeature
VIEWERJAVA-1999Print PDF documents which have restriction for printingFeature
VIEWERJAVA-2000Specify owner password, user password and permissions when rendering into PDFFeature
VIEWERJAVA-2002Detect restriction for the printingFeature
VIEWERJAVA-1987Improve performance for rendering PSD image format into PDFImprovement
VIEWERJAVA-1988Improve rendering Dicom, Dng and WebP formats into PDFImprovement
VIEWERJAVA-1990Extend support for CellsOptions.TextOverflowMode option for rendering into imageImprovement
VIEWERJAVA-1991Extend support for CellsOptions.TextOverflowMode option for rendering into PDFImprovement
VIEWERJAVA-1994Rendering contact photo from vCard file format (VCF)Improvement
VIEWERJAVA-1995Improve output for rendering zip archivesImprovement
VIEWERJAVA-1985Unable to render .xls fileBug
VIEWERJAVA-1986Output extension is empty when saving HTML page into cacheBug
VIEWERJAVA-1989Object null reference exception when rendering DWG documentBug
VIEWERJAVA-1992Watermark opacity set twice when rendering as HTMLBug
VIEWERJAVA-1993Separator is wrong for the opacity valueBug
VIEWERJAVA-2001Document corrupted exceptionBug

Public API and Backward Incompatible Changes

com.groupdocs.viewer.converter.options.ArchiveOptions

public class ArchiveOptions has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

com.groupdocs.viewer.converter.options.HtmlOptions

public ArchiveOptions getArchiveOptions() method has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

public void setArchiveOptions(ArchiveOptions) method has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

com.groupdocs.viewer.converter.options.ImageOptions

public ArchiveOptions getArchiveOptions() method has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

public void setArchiveOptions(ArchiveOptions) method has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

com.groupdocs.viewer.domain.ArchiveFileData

public class ArchiveFileData has been added

This class represents archive specific FileData.

com.groupdocs.viewer.domain.cache.CachedDocumentDescription

public ArchiveOptions getArchiveOptions() method has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

public void getArchiveOptions(ArchiveOptions) method has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

com.groupdocs.viewer.domain.cache.CachedPageDescription

public ArchiveOptions getArchiveOptions() method has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

public void setArchiveOptions(ArchiveOptions) method has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

com.groupdocs.viewer.domain.containers.ArchiveDocumentInfoContainer

public class ArchiveDocumentInfoContainer has been added

*ArchiveDocumentInfoContainer *class provides archive documents specific information as explained in the article Rendering Archive documents.

com.groupdocs.viewer.domain.containers.PdfDocumentInfoContainer

public class PdfDocumentInfoContainer class has been added

**
 * <p>
 * Represents a container for PDF document description.
 * </p>
 */
@Public
public class PdfDocumentInfoContainer extends DocumentInfoContainer {
    /**
     * <p>
     * Indicates whether source document has restriction on printing
     * </p>
     */
    private boolean mPrintingAllowed = false;

    /**
     * <p>
     * Indicates whether source document has restriction on printing
     * </p>
     */
    @Public
    public boolean getPrintingAllowed() {
        return mPrintingAllowed;
    }

    /**
     * <p>
     * Indicates whether source document has restriction on printing
     * </p>
     */
    @Public
    public void setPrintingAllowed(boolean value) {
        mPrintingAllowed = value;
    }
}


Check if source PDF document has restriction on printing

Since the version 19.11 GroupDocs.Viewer for Java API enables to check if PDF document has restriction on printing.

The following example demonstrates how to retrieve document information and check if the document has restrictions on printing.

Java (Render document into PDF with security settings)

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.setStoragePath("c:\\storage");

// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);

// Retrieve document information
String guid = "document.pdf";
PdfDocumentInfoContainer documentInfo = (PdfDocumentInfoContainer) imageHandler.getDocumentInfo(guid);
 
boolean printingAllowed = documentInfo.getPrintingAllowed();

com.groupdocs.viewer.domain.html.HtmlResource

public ArchiveOptions getArchiveOptions() method has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

public void setArchiveOptions(ArchiveOptions) method has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

com.groupdocs.viewer.domain.options

public enum PdfFilePermissions class has been added

/**
 * PDF file permissions
 */
@Public
public class PdfFilePermissions extends Enum {
    /**
     * Deny printing, modification and data extraction
     */
    public static final int NONE = 0;

    /**
     * Allow printing
     */
    public static final int PRINTING = 1;

    /**
     * Allow to modify content, fill in forms, add or modify annotations
     */
    public static final int MODIFICATION = 2;

    /**
     * Allow text and graphics extraction
     */
    public static final int DATA_EXTRACTION = 4;

    /**
     * Allow printing, modification and data extraction
     */
    public static final int ALL = PRINTING | MODIFICATION | DATA_EXTRACTION;
   
}


public class PdfFileSecurity class has been added

/**
 * Enables to specify owner password, user password and PDF file permissions
 */
public class PdfFileSecurity {
    private String mOwnerPassword;

    /**
     * Owner password enables to set PDF file permissions
     */
    @Public
    public String getOwnerPassword() {
        return mOwnerPassword;
    }

    private String mUserPassword;

    /**
     * User password restricts opening PDF file
     */
    @Public
    public String getUserPassword() {
        return mUserPassword;
    }

    private int mPdfFilePermissions;

    /**
     * PDF file permissions
     */
    @Public
    public int getPdfFilePermissions() {
        return mPdfFilePermissions;
    }

    /**
     * Creates new instance of this class
     *
     * @param ownerPassword      Owner password enables to set document permissions
     * @param userPassword       User password restricts opening PDF file
     * @param pdfFilePermissions PDF file permissions
     */
    @Public
    public PdfFileSecurity(String ownerPassword, String userPassword, int pdfFilePermissions) {
        if (ownerPassword == null)
            throw new ArgumentNullException("ownerPassword");
        if (userPassword == null)
            throw new ArgumentNullException("userPassword");

        mOwnerPassword = ownerPassword;
        mUserPassword = userPassword;
        mPdfFilePermissions = pdfFilePermissions;
    }
}


public PdfFileSecurity getPdfFileSecurity() method has been added to PdfFileOptions class

This method enables you to retrieve PDF file security settings.

public void setPdfFileSecurity(PdfFileSecurity) method has been added to PdfFileOptions class

This method enables you to set PDF file security settings.

Specify owner password, user password, and permissions when rendering into PDF

Since the version 19.11 GroupDocs.Viewer for Java API enables to specify owner password, user password, and PDF file permissions when rendering into PDF. API provides the following settings:  

  • Owner password - set owner password to require a password to change document permissions
  • User password - set user password to required password when opening a document
  • PDF file permissions - set permissions to allow or deny printing, modification and data extraction

Following example demonstrates how to render a document into PDF and set a password for opening, password to change document permissions and permissions to deny printing

(Render document into PDF with security settings)

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.setStoragePath("c:\\storage");

// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);

// Create PDF file security
String ownerPassword = "owner password";
String userPassword = "user password";
int denyPrinting = PdfFilePermissions.ALL ^ PdfFilePermissions.PRINTING;
PdfFileSecurity pdfFileSecurity = new PdfFileSecurity(ownerPassword, userPassword, denyPrinting);

// Create options
PdfFileOptions pdfFileOptions = new PdfFileOptions();
pdfFileOptions.setPdfFileSecurity(pdfFileSecurity);

String guid = "document.doc";
FileContainer fileContainer = imageHandler.getPdfFile(guid, pdfFileOptions);

com.groupdocs.viewer.domain.options.DocumentInfoOptions

public ArchiveOptions getArchiveOptions() method has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

public void setArchiveOptions(ArchiveOptions) method has been added

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

com.groupdocs.viewer.domain.options.PdfFileOptions

public ArchiveOptions getArchiveOptions() method has been added.

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.

public void setArchiveOptions(ArchiveOptions) method has been added.

ArchiveOptions class allows specifying archive documents specific rendering options as explained in the article Rendering Archive documents.