com.sevenpdf.service
Class PDFService

java.lang.Object
  extended by com.sevenpdf.service.PDFService

public class PDFService
extends java.lang.Object

7-PDF Java Library
Date: 10.12.2009

This java library makes it possible to connect directly to a 7-PDF Api Service.
Currently 7-PDF Api Service supports 84 file formats that can be directly converted to PDF without any third-party-application.
So this java library gives you the possibility to create PDF-on-the-fly by using a powerfull client/server based conversion service.

Only with this java object class you can define multiple pdf settings for example, doing pdf file encryptions or set some permissions.
The connection to a 7-PDF Api Service is possible over web or intranet by using the HTTP-Protocol. For this, you have to register and get an free conversion account at http://www.7-pdf.de

Version:
1.0
Author:
Thorsten Hodes

Constructor Summary
PDFService(java.lang.String ServiceURL, java.lang.String ServiceUser, java.lang.String ServicePassword)
           
 
Method Summary
 boolean Convert(java.io.File SourceFile, java.io.File PDFFile)
          Starts a conversion run.
 java.lang.String GetPDFOptionDocumentOpenPassword()
          Gets the PDFOption DocumentOpenPassword.
 boolean GetPDFOptionEnableCopyingOfContent()
          Gets the PDFOption EnableCopyingOfContent.
 boolean GetPDFOptionEnableTextAccessForAccessibilityTools()
          Gets the PDFOption EnableTextAccessForAccessibilityTools.
 boolean GetPDFOptionEncryptFile()
          Gets the PDFOption Value EncryptFile.
 boolean GetPDFOptionExportBookmarks()
          Gets the PDFOption Value ExportBookmarks.
 boolean GetPDFOptionExportNotes()
          Gets the PDFOption Value ExportNotes.
 boolean GetPDFOptionExportNotesPages()
          Gets the PDFOption Value ExportNotesPages.
 int GetPDFOptionImageQuality()
          Gets the PDFOption Value ImageQuality.
 int GetPDFOptionMaxImageResolution()
          Gets the PDFOption MaxImageResolution.
 java.lang.String GetPDFOptionPageRange()
          Gets the PDFOption Value PageRange.
 int GetPDFOptionPermissionChanges()
          Gets the PDFOption Value PermissionChanges.
 java.lang.String GetPDFOptionPermissionPassword()
          Gets the PDFOption PermissionPassword.
 int GetPDFOptionPermissionPrinting()
          Gets the PDFOption Value PermissionPrinting.
 boolean GetPDFOptionReduceImageResolution()
          Gets the PDFOption Value ReduceImageResolution.
 boolean GetPDFOptionRestrictPermissions()
          Gets the PDFOption Value RestrictPermissions.
 int GetPDFOptionSelectPDFVersion()
          Gets the PDFOption Value SelectPDFVersion.
 boolean GetPDFOptionUseLosslessCompression()
          Gets the PDFOption Value UseLosslessCompression.
 boolean GetPDFOptionUseTaggedPDF()
          Gets the PDFOption Value UseTaggedPDF.
 void SetPDFOptionDocumentOpenPassword(java.lang.String Value)
          Sets the PDFOption DocumentOpenPassword.
 void SetPDFOptionEnableCopyingOfContent(boolean Value)
          Sets the PDFOption EnableCopyingOfContent.
 void SetPDFOptionEnableTextAccessForAccessibilityTools(boolean Value)
          Sets the PDFOption EnableTextAccessForAccessibilityTools.
 void SetPDFOptionEncryptFile(boolean Value)
          Sets the PDFOption EncryptFile.
 void SetPDFOptionExportBookmarks(boolean Value)
          Sets the PDFOption ExportBookmarks.
 void SetPDFOptionExportNotes(boolean Value)
          Sets the PDFOption ExportNotes.
 void SetPDFOptionExportNotesPages(boolean Value)
          Sets the PDFOption ExportNotesPages.
 void SetPDFOptionImageQuality(int Value)
          Sets the PDFOption ImageQuality.
 void SetPDFOptionMaxImageResolution(int Value)
          Sets the PDFOption MaxImageResolution.
 void SetPDFOptionPageRange(java.lang.String Value)
          Sets the PDFOption PageRange.
 void SetPDFOptionPermissionChanges(int Value)
          Sets the PDFOption PermissionChanges.
 void SetPDFOptionPermissionPassword(java.lang.String Value)
          Sets the PDFOption PermissionPassword.
 void SetPDFOptionPermissionPrinting(int Value)
          Sets the PDFOption PermissionPrinting.
 void SetPDFOptionReduceImageResolution(boolean Value)
          Sets the PDFOption ReduceImageResolution.
 void SetPDFOptionRestrictPermissions(boolean Value)
          Sets the PDFOption RestrictPermissions.
 void SetPDFOptionSelectPDFVersion(int Value)
          Sets the PDFOption SelectPDFVersion.
 void SetPDFOptionUseLosslessCompression(boolean Value)
          Sets the PDFOption UseLosslessCompression.
 void SetPDFOptionUseTaggedPDF(boolean Value)
          Sets the PDFOption UseTaggedPDF.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFService

public PDFService(java.lang.String ServiceURL,
                  java.lang.String ServiceUser,
                  java.lang.String ServicePassword)
Parameters:
ServerURL - The URL-Location where a 7-PDF Api Service is running.
For example http://localhost:8080, https://www.your-domain.de, http://127.0.0.1:8080)
Username - The Service-User that is necessary to connect the 7-PDF Remote Api Service.
Password - The Service-Password that is necessary to connect the 7-PDF Remote Api Service.
Method Detail

Convert

public boolean Convert(java.io.File SourceFile,
                       java.io.File PDFFile)
Starts a conversion run.

Parameters:
SourceFile - The file that you would like to convert to PDF.
PDFFile - The result pdf.
Returns:
True if conversion run was successfull, false if not.

SetPDFOptionUseTaggedPDF

public void SetPDFOptionUseTaggedPDF(boolean Value)
Sets the PDFOption UseTaggedPDF.

Parameters:
Value - The value can be true or false (default).

GetPDFOptionUseTaggedPDF

public boolean GetPDFOptionUseTaggedPDF()
Gets the PDFOption Value UseTaggedPDF.

Returns:
The value can be true or false.

SetPDFOptionExportNotes

public void SetPDFOptionExportNotes(boolean Value)
Sets the PDFOption ExportNotes.

Parameters:
Value - The value can be true or false (default).

GetPDFOptionExportNotes

public boolean GetPDFOptionExportNotes()
Gets the PDFOption Value ExportNotes.

Returns:
The value can be true or false.

SetPDFOptionExportNotesPages

public void SetPDFOptionExportNotesPages(boolean Value)
Sets the PDFOption ExportNotesPages.

Parameters:
Value - The value can be true or false (default).

GetPDFOptionExportNotesPages

public boolean GetPDFOptionExportNotesPages()
Gets the PDFOption Value ExportNotesPages.

Returns:
The value can be true or false.

SetPDFOptionExportBookmarks

public void SetPDFOptionExportBookmarks(boolean Value)
Sets the PDFOption ExportBookmarks.

Parameters:
Value - The value can be true (default) or false.

GetPDFOptionExportBookmarks

public boolean GetPDFOptionExportBookmarks()
Gets the PDFOption Value ExportBookmarks.

Returns:
The value can be true or false.

SetPDFOptionSelectPDFVersion

public void SetPDFOptionSelectPDFVersion(int Value)
Sets the PDFOption SelectPDFVersion.

Parameters:
Value - The value can be 0 (PDF 1.4, default) or 1 (PDF/A-1).

GetPDFOptionSelectPDFVersion

public int GetPDFOptionSelectPDFVersion()
Gets the PDFOption Value SelectPDFVersion.

Returns:
The value can be 0 (PDF 1.4) or 1 (PDF/A-1).

SetPDFOptionPageRange

public void SetPDFOptionPageRange(java.lang.String Value)
Sets the PDFOption PageRange.

Parameters:
Value - The value can be a valid PageRange string like 1; 1-2;
e.g. or you leave it empty for all pages.

GetPDFOptionPageRange

public java.lang.String GetPDFOptionPageRange()
Gets the PDFOption Value PageRange.

Returns:
The value can be a valid PageRange string.

SetPDFOptionUseLosslessCompression

public void SetPDFOptionUseLosslessCompression(boolean Value)
Sets the PDFOption UseLosslessCompression.

Parameters:
Value - The image compression state can be true (default) or false.

GetPDFOptionUseLosslessCompression

public boolean GetPDFOptionUseLosslessCompression()
Gets the PDFOption Value UseLosslessCompression.

Returns:
The value can be true or false.

SetPDFOptionImageQuality

public void SetPDFOptionImageQuality(int Value)
Sets the PDFOption ImageQuality.

Parameters:
Value - Possible value range from 0 - 100 (percent).

GetPDFOptionImageQuality

public int GetPDFOptionImageQuality()
Gets the PDFOption Value ImageQuality.

Returns:
The value can be in range of 0 - 100 (percent). Default = 50.
Notice: If UseLosslessCompression is set to True, then the ImageQuality PDF Option is disabled.

SetPDFOptionReduceImageResolution

public void SetPDFOptionReduceImageResolution(boolean Value)
Sets the PDFOption ReduceImageResolution.

Parameters:
Value - The ReduceImageResolution state can be true or false (default).

GetPDFOptionReduceImageResolution

public boolean GetPDFOptionReduceImageResolution()
Gets the PDFOption Value ReduceImageResolution.

Returns:
The value can be true or false.

SetPDFOptionMaxImageResolution

public void SetPDFOptionMaxImageResolution(int Value)
Sets the PDFOption MaxImageResolution.

Parameters:
Value - Possible values (dpi) are:
     75 (default)
     150
     300
     600
     1200

Notice: The PDF Option ReduceImageResolution must be set to true to enable this option.


GetPDFOptionMaxImageResolution

public int GetPDFOptionMaxImageResolution()
Gets the PDFOption MaxImageResolution.

Returns:
The value can be 75, 150, 300, 600, 1200 (dpi).

SetPDFOptionEncryptFile

public void SetPDFOptionEncryptFile(boolean Value)
Sets the PDFOption EncryptFile.

Parameters:
Value - The encryption state can be true (encrypt files) or false (no encryption, default).

GetPDFOptionEncryptFile

public boolean GetPDFOptionEncryptFile()
Gets the PDFOption Value EncryptFile.

Returns:
The value can be true (encrypt files) or false (no encryption).

SetPDFOptionDocumentOpenPassword

public void SetPDFOptionDocumentOpenPassword(java.lang.String Value)
Sets the PDFOption DocumentOpenPassword.

Parameters:
Value - The value can be any password string that you would like to use for your pdf encryption.

GetPDFOptionDocumentOpenPassword

public java.lang.String GetPDFOptionDocumentOpenPassword()
Gets the PDFOption DocumentOpenPassword.

Returns:
The value can be any password string for a pdf encryption.

SetPDFOptionRestrictPermissions

public void SetPDFOptionRestrictPermissions(boolean Value)
Sets the PDFOption RestrictPermissions.

Parameters:
Value - The restrict permission state can be true (pdf with permission settings) or false (pdf without permission settings, default).

GetPDFOptionRestrictPermissions

public boolean GetPDFOptionRestrictPermissions()
Gets the PDFOption Value RestrictPermissions.

Returns:
The value can be true (pdf with permission settings) or false (pdf without permission settings).

SetPDFOptionPermissionPassword

public void SetPDFOptionPermissionPassword(java.lang.String Value)
Sets the PDFOption PermissionPassword.

Parameters:
Value - The value can be any password string that you would like to use for your pdf permission settings.

GetPDFOptionPermissionPassword

public java.lang.String GetPDFOptionPermissionPassword()
Gets the PDFOption PermissionPassword.

Returns:
The value can be any password string for a pdf permission settings.

SetPDFOptionPermissionPrinting

public void SetPDFOptionPermissionPrinting(int Value)
Sets the PDFOption PermissionPrinting.

Parameters:
Value - Possible values are:
     0: Not permitted
     1: Low resolution (150 DPI)
     2: High resolution (default)

GetPDFOptionPermissionPrinting

public int GetPDFOptionPermissionPrinting()
Gets the PDFOption Value PermissionPrinting.

Returns:
The value can be 0, 1 or 2.

SetPDFOptionPermissionChanges

public void SetPDFOptionPermissionChanges(int Value)
Sets the PDFOption PermissionChanges.

Parameters:
Value - Possible values are:
     0: Not permitted
     1: Inserting, deleting and rotating pages
     2: Filling in form fields
     3: Commenting, filling in form fields
     4: Any except extracting pages (default)

GetPDFOptionPermissionChanges

public int GetPDFOptionPermissionChanges()
Gets the PDFOption Value PermissionChanges.

Returns:
The value can be 0, 1, 2, 3, 4.

SetPDFOptionEnableCopyingOfContent

public void SetPDFOptionEnableCopyingOfContent(boolean Value)
Sets the PDFOption EnableCopyingOfContent.

Parameters:
Value - This permission value can be true (default) or false;

GetPDFOptionEnableCopyingOfContent

public boolean GetPDFOptionEnableCopyingOfContent()
Gets the PDFOption EnableCopyingOfContent.

Returns:
This permission value can be true or false;

SetPDFOptionEnableTextAccessForAccessibilityTools

public void SetPDFOptionEnableTextAccessForAccessibilityTools(boolean Value)
Sets the PDFOption EnableTextAccessForAccessibilityTools.

Parameters:
Value - This permission value can be true (default) or false;

GetPDFOptionEnableTextAccessForAccessibilityTools

public boolean GetPDFOptionEnableTextAccessForAccessibilityTools()
Gets the PDFOption EnableTextAccessForAccessibilityTools.

Returns:
This permission value can be true or false;


Copyright © 2009 7-PDF, Germany - Thorsten Hodes. All rights reserved!