file2xliff4j
Class PdfExporterToWord

java.lang.Object
  extended by file2xliff4j.PdfExporterToWord
All Implemented Interfaces:
Converter

public class PdfExporterToWord
extends java.lang.Object
implements Converter

Exporter of original PDF document's translation to Word format.

Author:
Weldon Whipple <weldon@lingotek.com>

Field Summary
 
Fields inherited from interface file2xliff4j.Converter
BLKSIZE, formatSuffix, skeletonSuffix, startXliff, stylesTSkeletonSuffix, tSkeletonSuffix, xliffSuffix, xmlDeclaration
 
Constructor Summary
PdfExporterToWord()
          Creates a new instance of PdfExporterToWord
 
Method Summary
 ConversionStatus convert(ConversionMode mode, java.util.Locale language, java.lang.String phaseName, int maxPhase, java.nio.charset.Charset nativeEncoding, FileType nativeFileType, java.lang.String nativeFileName, java.lang.String baseDir, Notifier notifier)
          Deprecated. 
 ConversionStatus convert(ConversionMode mode, java.util.Locale language, java.lang.String phaseName, int maxPhase, java.nio.charset.Charset nativeEncoding, FileType nativeFileType, java.lang.String nativeFileName, java.lang.String baseDir, Notifier notifier, SegmentBoundary boundary, java.io.StringWriter generatedFileName)
          Convert one set of targets (in the translation units of an XLIFF file created from a PDF document) to Word Format.
 ConversionStatus convert(ConversionMode mode, java.util.Locale language, java.lang.String phaseName, int maxPhase, java.nio.charset.Charset nativeEncoding, FileType nativeFileType, java.lang.String nativeFileName, java.lang.String baseDir, Notifier notifier, SegmentBoundary boundary, java.io.StringWriter generatedFileName, java.util.Set<f2xutils.XMLTuXPath> skipList)
          Convert one set of targets (in the translation units of an XLIFF file) back to the original HTML format, using the skeleton and format files that were generated when the XLIFF file was created.
 java.lang.Object getConversionProperty(java.lang.String property)
          Return an object representing a format-specific (and converter-specific) property.
 FileType getFileType()
          Return the file type that this converter handles.
 void setConversionProperty(java.lang.String property, java.lang.Object value)
          Set a format-specific property that might affect the way that the conversion occurs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdfExporterToWord

public PdfExporterToWord()
Creates a new instance of PdfExporterToWord

Method Detail

convert

@Deprecated
public ConversionStatus convert(ConversionMode mode,
                                           java.util.Locale language,
                                           java.lang.String phaseName,
                                           int maxPhase,
                                           java.nio.charset.Charset nativeEncoding,
                                           FileType nativeFileType,
                                           java.lang.String nativeFileName,
                                           java.lang.String baseDir,
                                           Notifier notifier)
                         throws ConversionException
Deprecated. 

Convert one set of targets (in the translation units of an XLIFF file created from a PDF document) to Word Format.

Specified by:
convert in interface Converter
Parameters:
mode - The mode of conversion (to or from XLIFF).
language - The language of the XLIFF targets to use in constructing the native-format document.
phaseName - The name of the phase to export. If this parameter's value is not null, it is matched against the value of the optional phase-name attribute of the target elements of the XLIFF document. If null, no check is made against a phase-name attribute.

If the phase name string consists entirely of numeric digit(s) equivalent to an integer with value greater than 1 but less than or equal to maxPhase (see next parameter) search for targets with lower numbered phase names.

maxPhase - The maximum phase number. If phaseName is specified as "0" and maxPhase is a non-negative integer, search for the highest "numbered" phase, starting at maxPhase, and searching down to phase "1".
nativeEncoding - This parameter is ignored--the default encoding is used in the output document in all cases.
nativeFileType - This parameter is ignored by this converter.
nativeFileName - The name of the original document that was originally converted to XLIFF. It is used to determine the name of the XLIFF file (<nativeFileName>.xliff), the skeleton file (<nativeFileName>.skeleton) and the format file (<nativeFileName>.format). It is also used in constructing the file name of the output file.
baseDir - The directory (in the file system) from which input files (XLIFF, skeleton and format files) will be read, and to which output file will be written.
notifier - Instance of a class that implements the Notifier interface (to send notifications in case of conversion error).
Returns:
Indicator of the status of the conversion.
Throws:
ConversionException - If a conversion exception is encountered.

convert

public ConversionStatus convert(ConversionMode mode,
                                java.util.Locale language,
                                java.lang.String phaseName,
                                int maxPhase,
                                java.nio.charset.Charset nativeEncoding,
                                FileType nativeFileType,
                                java.lang.String nativeFileName,
                                java.lang.String baseDir,
                                Notifier notifier,
                                SegmentBoundary boundary,
                                java.io.StringWriter generatedFileName)
                         throws ConversionException
Convert one set of targets (in the translation units of an XLIFF file created from a PDF document) to Word Format.

Specified by:
convert in interface Converter
Parameters:
mode - The mode of conversion (to or from XLIFF).
language - The language of the XLIFF targets to use in constructing the native-format document.
phaseName - The name of the phase to export. If this parameter's value is not null, it is matched against the value of the optional phase-name attribute of the target elements of the XLIFF document. If null, no check is made against a phase-name attribute.

If the phase name string consists entirely of numeric digit(s) equivalent to an integer with value greater than 1 but less than or equal to maxPhase (see next parameter) search for targets with lower numbered phase names.

maxPhase - The maximum phase number. If phaseName is specified as "0" and maxPhase is a non-negative integer, search for the highest "numbered" phase, starting at maxPhase, and searching down to phase "1".
nativeEncoding - This parameter is ignored--the default encoding is used in the output document in all cases.
nativeFileType - This parameter is ignored by this converter.
nativeFileName - The name of the original document that was originally converted to XLIFF. It is used to determine the name of the XLIFF file (<nativeFileName>.xliff), the skeleton file (<nativeFileName>.skeleton) and the format file (<nativeFileName>.format). It is also used in constructing the file name of the output file.
baseDir - The directory (in the file system) from which input files (XLIFF, skeleton and format files) will be read, and to which output file will be written.
notifier - Instance of a class that implements the Notifier interface (to send notifications in case of conversion error).
boundary - (Ignored. The boundary on which to segment translation units (e.g., on paragraph or sentence boundaries) is meaningful only for importers--converters that generate XLIFF from documents.)
generatedFileName - If non-null, the converter will write the name of the file (without parent directories) to which the generated output file was written.
Returns:
Indicator of the status of the conversion.
Throws:
ConversionException - If a conversion exception is encountered.

convert

public ConversionStatus convert(ConversionMode mode,
                                java.util.Locale language,
                                java.lang.String phaseName,
                                int maxPhase,
                                java.nio.charset.Charset nativeEncoding,
                                FileType nativeFileType,
                                java.lang.String nativeFileName,
                                java.lang.String baseDir,
                                Notifier notifier,
                                SegmentBoundary boundary,
                                java.io.StringWriter generatedFileName,
                                java.util.Set<f2xutils.XMLTuXPath> skipList)
                         throws ConversionException
Convert one set of targets (in the translation units of an XLIFF file) back to the original HTML format, using the skeleton and format files that were generated when the XLIFF file was created.

Specified by:
convert in interface Converter
Parameters:
mode - The mode of conversion (to or from XLIFF).
language - The language of the XLIFF targets to use in constructing the native-format document.
phaseName - The name of the phase to export. If this parameter's value is not null, it is matched against the value of the optional phase-name attribute of the target elements of the XLIFF document. If null, no check is made against a phase-name attribute.

If the phase name string consists entirely of numeric digit(s) equivalent to an integer with value greater than 1 but less than or equal to maxPhase (see next parameter) search for targets with lower numbered phase names.

maxPhase - The maximum phase number. If phaseName is specified as "0" and maxPhase is a non-negative integer, search for the highest "numbered" phase, starting at maxPhase, and searching down to phase "1".
nativeEncoding - The encoding of the native document. This parameter tells the converter what to convert the UTF-8 encoding back to. (Note: The choice of encoding may depend on the target language. Encodings like Shift_JIS and EUCJP, for example, are appropriate for Japanese targets only. UTF-8 can be used for all target languages.)
nativeFileType - This parameter is ignored. (In conversions from XLIFF, the native file type stored in the XLIFF--specified when the XLIFF was created--is used.)
nativeFileName - The name of the original document that was originally converted to XLIFF. It is used to determine the name of the XLIFF file (<nativeFileName>.xliff), the skeleton file (<nativeFileName>.skeleton) and the format file (<nativeFileName>.format). It is also used in constructing the file name of the output HTML formatted file: <nativeFileName>.<language>.html (if the original file's "extension" wasn't ".html", the original extension is used instead.)
baseDir - The directory (in the file system) from which input files (XLIFF, skeleton and format files) will be read, and to which output file will be written.
notifier - Instance of a class that implements the Notifier interface (to send notifications in case of conversion error).
boundary - (Ignored. The boundary on which to segment translation units (e.g., on paragraph or sentence boundaries) is meaningful only for importers--converters that generate XLIFF from documents.)
generatedFileName - If non-null, the converter will write the name of the file (without parent directories) to which the generated output file was written.
skipList - (Not used by this converter.)
Returns:
Indicator of the status of the conversion.
Throws:
ConversionException - If a conversion exception is encountered.

getConversionProperty

public java.lang.Object getConversionProperty(java.lang.String property)
Return an object representing a format-specific (and converter-specific) property.

Specified by:
getConversionProperty in interface Converter
Parameters:
property - The name of the property to return.
Returns:
An Object that represents the property's value.

getFileType

public FileType getFileType()
Return the file type that this converter handles. (For importers, this means the file type that it imports to XLIFF; for exporters, it is the file type that ie exports to (from XLIFF).

Specified by:
getFileType in interface Converter
Returns:
the PDF file type.

setConversionProperty

public void setConversionProperty(java.lang.String property,
                                  java.lang.Object value)
                           throws ConversionException
Set a format-specific property that might affect the way that the conversion occurs.

Note: This exporter needs to know of a directory prefix to prepend to image file names that appear on the src attribute of img tags in the intermediate HTML. This method is a way to communicate that information.

Specified by:
setConversionProperty in interface Converter
Parameters:
property - The name of the property
value - The value of the property
Throws:
ConversionException - If the property isn't recognized (and if it matters).