PdfProducer

Inheritance: java.lang.Object

public abstract class PdfProducer

Represents a class to produce PDF from other formats.


This sample shows how to produce Pdf file from CGM file.

 String inputFile = "myImage.cgm";
 String outputFile = "myPdf.pdf";
 try
 {
     PdfProducer.produce(inputFile, ImportFormat.Cgm, outputFile);
     // Success produced pdf file.
 }
 catch (Exception e)
 {
     //  Do something...
 }

Methods

MethodDescription
produce(InputStream inputStream, int format, OutputStream outputStream)Produce the PDF stream using specified import format.
produce(String inputFileName, int format, OutputStream outputStream)
produce(InputStream inputStream, int format, String outputFileName)Produce the PDF file using specified import format.
produce(String inputFileName, int format, String outputFileName)Produce the PDF file using specified import format.
produce(String inputFileName, ImportOptions options, OutputStream outputStream)
produce(InputStream inputStream, ImportOptions options, String outputFileName)
produce(String inputFileName, ImportOptions options, String outputFileName)Produce the PDF file using specified import option.
produce(InputStream inputStream, ImportOptions options, OutputStream outputStream)Produce the PDF file using specified import option.
produceInternal(System.IO.Stream inputStream, ImportOptions options, System.IO.Stream outputStream)
getProducer(ImportOptions options)Get the producer for specified import option.
getProducer(int format)Get the producer for specified import format.
getImportOptions(int format)Get the ImportOptions for specified import format.

produce(InputStream inputStream, int format, OutputStream outputStream)

public static void produce(InputStream inputStream, int format, OutputStream outputStream)

Produce the PDF stream using specified import format.

Parameters:

ParameterTypeDescription
inputStreamjava.io.InputStreamInput stream.
formatintImport format.
outputStreamjava.io.OutputStreamOutput PDF stream.

produce(String inputFileName, int format, OutputStream outputStream)

public static void produce(String inputFileName, int format, OutputStream outputStream)

Parameters:

ParameterTypeDescription
inputFileNamejava.lang.String
formatint
outputStreamjava.io.OutputStream

produce(InputStream inputStream, int format, String outputFileName)

public static void produce(InputStream inputStream, int format, String outputFileName)

Produce the PDF file using specified import format.


This sample shows how to produce Pdf file from CGM stream.

 String inputFile = "myImage.cgm";
 String outputFile = "myPdf.pdf";
 using (FileInputStream inputStream = File.OpenRead(inputFile))
 using (FileOutputStream outputStream = File.Create(outputFile))
 {
     PdfProducer.produce(inputStream, ImportFormat.Cgm, outputStream);
 }

Parameters:

ParameterTypeDescription
inputStreamjava.io.InputStreamInput stream.
formatintImport format.
outputFileNamejava.lang.StringOutput PDF file

produce(String inputFileName, int format, String outputFileName)

public static void produce(String inputFileName, int format, String outputFileName)

Produce the PDF file using specified import format.


This sample shows how to produce Pdf file from CGM file.

 String inputFile = "myImage.cgm";
 String outputFile = "myPdf.pdf";
 PdfProducer.produce(inputFile, ImportFormat.Cgm, outputFile);

Parameters:

ParameterTypeDescription
inputFileNamejava.lang.StringInput file name.
formatintImport format.
outputFileNamejava.lang.StringOutput PDF file

produce(String inputFileName, ImportOptions options, OutputStream outputStream)

public static void produce(String inputFileName, ImportOptions options, OutputStream outputStream)

Parameters:

ParameterTypeDescription
inputFileNamejava.lang.String
optionsImportOptions
outputStreamjava.io.OutputStream

produce(InputStream inputStream, ImportOptions options, String outputFileName)

public static void produce(InputStream inputStream, ImportOptions options, String outputFileName)

Parameters:

ParameterTypeDescription
inputStreamjava.io.InputStream
optionsImportOptions
outputFileNamejava.lang.String

produce(String inputFileName, ImportOptions options, String outputFileName)

public static void produce(String inputFileName, ImportOptions options, String outputFileName)

Produce the PDF file using specified import option.


This sample shows how to produce Pdf file from CGM file.

 String inputFile = "myImage.cgm";
 String outputFile = "myPdf.pdf";
 ImportOptions importOptions = new CgmImportOptions();
 PdfProducer.produce(inputStream, importOptions, outputStream);

Parameters:

ParameterTypeDescription
inputFileNamejava.lang.StringInput file name.
optionsImportOptionsImport option.
outputFileNamejava.lang.StringOutput PDF stream.

produce(InputStream inputStream, ImportOptions options, OutputStream outputStream)

public static void produce(InputStream inputStream, ImportOptions options, OutputStream outputStream)

Produce the PDF file using specified import option.


This sample shows how to produce Pdf stream from CGM stream.

 String inputFile = "myImage.cgm";
 String outputFile = "myPdf.pdf";
 ImportOptions importOptions = new CgmImportOptions();
 using (FileInputStream inputStream = File.OpenRead(inputFile))
 using (FileOutputStream outputStream = File.Create(outputFile))
 {
     PdfProducer.produce(inputStream, importOptions, outputStream);
 }

Parameters:

ParameterTypeDescription
inputStreamjava.io.InputStreamInput stream.
optionsImportOptionsImport option.
outputStreamjava.io.OutputStreamOutput PDF stream.

produceInternal(System.IO.Stream inputStream, ImportOptions options, System.IO.Stream outputStream)

public static void produceInternal(System.IO.Stream inputStream, ImportOptions options, System.IO.Stream outputStream)

Parameters:

ParameterTypeDescription
inputStreamcom.aspose.ms.System.IO.Stream
optionsImportOptions
outputStreamcom.aspose.ms.System.IO.Stream

getProducer(ImportOptions options)

public static PdfProducer getProducer(ImportOptions options)

Get the producer for specified import option.

Parameters:

ParameterTypeDescription
optionsImportOptionsImport option

Returns: PdfProducer - PDF producer.

getProducer(int format)

public static PdfProducer getProducer(int format)

Get the producer for specified import format.

Parameters:

ParameterTypeDescription
formatintImport option

Returns: PdfProducer - PDF producer.

getImportOptions(int format)

public static ImportOptions getImportOptions(int format)

Get the ImportOptions for specified import format.

Parameters:

ParameterTypeDescription
formatintImport format.

Returns: ImportOptions - Import option.