Initialize JBIG2 plugin

<< Click to Display Table of Contents >>

Navigation:  Tasks >

Initialize JBIG2 plugin

JBIG2 support is not linked into the WPViewPDF engine.

 

However You can use the command

      COMPDF_SetJBIG2Tool = 1293

to provide a path and command line parameters to an external tool to convert JBIG2 data to BPM. If the viewer finds the program, it will be used to convert embedded JBIG2 data streams to bitmaps. First the JBIG2 streams are saved into a standard JB2 file and then passed to the conversion tool. The resulting bitmap file (it is expected to be in PBM "P4" format) is loaded and displayed. The intermediate files are deleted at once. The conversion program is called invisibly, without showing a window.

 

WPViewPDF now includes a JBIG2 decode implemented in the module wpdecodejp.dll and, for 64 bit, wpdecodejp64.dll.

It is not required to call the command COMPDF_SetJBIG2Tool when the converter DLLs have been copied to the EXE directory. It is also not required to install the plugin exe.

Command COMPDF_SetJBIG2Tool with an integer parameter 1 and the path as string parameter can be used to manually load the decoding DLL. It will return 1 if the DLL was loaded, 0 if not.

 

 

For security reasons the conversion is only called to decode image data, not other stream data, although the PDF specification would allow it.

 

Example:  

WPViewPDF.Command( 1293, "{dll}convert.exe {in} -o {out}").

The token {in} will be replaced by the engine with a temporary file name of the input data,

{out} will be replaced by the engine with the name of the temporary output file.

(Both files will be deleted when finished.)  

{dll} will be replaced by the engine with the path where the WPViewPDF engine was loaded from.

 

Please make sure the program name is followed by a space (#32), the tokens {xx} must not contain spaces.

If {in} was not specified, the utility will be called with a temporary file as parameter. The output data will be then expected to have the same name with .pbm as file extension, also if {in} was specified, but {out} was not.

 

Many similar PDF packages use a project called jbig2dec - Copyright (C) 2002-2005 Artifex Software, Inc.

 

The tool jbig2dec is licensed under GNU license -

You can download a C++Builder project including source and windows binary here (last update 30.4.2014).

 

WPViewPDF does not integrate the tool, however it is possible to call it as external plugin.

 

Hint: If you use pdfPrint you can use the option JBIG2TOOL=...

 

License text file which comes with jbig2dec (it is included in the project ZIP file)

 

The files in this directory (folder) and any subdirectories

(sub-folders) thereof are part of jbig2dec, with the exception of

certain source files included to support portability which are marked

otherwise in their copyright headers.

 

jbig2dec is free software; you can redistribute it and/or modify it

under the terms the GNU General Public License as published by the

Free Software Foundation, either version 2 of the License, or (at your

option) any later version.

 

This software is distributed in the hope that it will be useful, but

WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU

General Public License for more details.

 

You should have received a copy of the GNU General Public License

along with this program in the file named COPYING. If not, write to

the Free Software Foundation, Inc., 59 Temple Place Suite 330, Boston,

MA 02111-1307, USA.

 

In addition, specific permission is given to link jbig2dec to or

compile jbig2dec into AFPL Ghostscript and to distribute same under

the Aladdin Free Public License (AFPL) version 9.