Convert

Inheritance: java.lang.Object

public class Convert

Represents a group of methods intended to convert Presentation.


Convert.AutoByExtension("pres.pptx", "pres.pdf");

Constructors

ConstructorDescription
Convert()

Methods

MethodDescription
autoByExtension(String presPath, String outPath)Converts Presentation using the passed output path extension to determine the required export format.
toPdf(String presPath, String outPath)Converts Presentation to PDF.
toPdf(String presPath, String outPath, IPdfOptions options)Converts Presentation to PDF.
toPdf(Presentation pres, String outPath)Converts Presentation to PDF.
toPdf(Presentation pres, String outPath, IPdfOptions options)Converts Presentation to PDF.
toSvg(String presPath)Converts Presentation to SVG.
toSvg(String presPath, Convert.GetOutPathCallback getOutPath)Converts Presentation to SVG.
toSvg(Presentation pres, Convert.GetOutPathCallback getOutPath)Converts Presentation to SVG.
toSvg(Presentation pres, ISVGOptions options)Converts Presentation to SVG.
toSvg(Presentation pres, Convert.GetOutPathCallback getOutPath, ISVGOptions options)Converts Presentation to SVG.
toJpeg(Presentation pres, String outputFileName)Converts the input presentation to a set of JPEG format images.
toJpeg(Presentation pres, String outputFileName, Dimension imageSize)Converts the input presentation to a set of JPEG format images.
toJpeg(Presentation pres, String outputFileName, float scale, IRenderingOptions options)Converts the input presentation to a set of JPEG format images.
toPng(Presentation pres, String outputFileName)Converts the input presentation to a set of PNG format images.
toPng(Presentation pres, String outputFileName, Dimension imageSize)Converts the input presentation to a set of PNG format images.
toPng(Presentation pres, String outputFileName, float scale, IRenderingOptions options)Converts the input presentation to a set of PNG format images.
toTiff(Presentation pres, String outputFileName)Converts the input presentation to a set of TIFF format images.
toTiff(Presentation pres, String outputFileName, ITiffOptions options, boolean multipage)Converts the input presentation to TIFF format with custom options.

Convert()

public Convert()

autoByExtension(String presPath, String outPath)

public static void autoByExtension(String presPath, String outPath)

Converts Presentation using the passed output path extension to determine the required export format.


Convert.autoByExtension("pres.pptx", "pres.pdf");

Parameters:

ParameterTypeDescription
presPathjava.lang.StringPath of the input presentation
outPathjava.lang.StringOutput path

toPdf(String presPath, String outPath)

public static void toPdf(String presPath, String outPath)

Converts Presentation to PDF.


Convert.toPdf("pres.pptx", "pres.pdf");

Parameters:

ParameterTypeDescription
presPathjava.lang.StringPath of the input presentation
outPathjava.lang.StringOutput path

toPdf(String presPath, String outPath, IPdfOptions options)

public static void toPdf(String presPath, String outPath, IPdfOptions options)

Converts Presentation to PDF.


PdfOptions pdfOptions = new PdfOptions();
 pdfOptions.setCompliance(PdfCompliance.PdfUa);
 Convert.toPdf("pres.pptx", "pres.pdf", pdfOptions);

Parameters:

ParameterTypeDescription
presPathjava.lang.StringPath of the input presentation
outPathjava.lang.StringOutput path
optionsIPdfOptionsOutput PDF options

toPdf(Presentation pres, String outPath)

public static void toPdf(Presentation pres, String outPath)

Converts Presentation to PDF.


Presentation pres = new Presentation("input.pptx");
 try {
     Convert.toPdf(pres, "output.pdf");
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationInput presentation
outPathjava.lang.StringOutput path

toPdf(Presentation pres, String outPath, IPdfOptions options)

public static void toPdf(Presentation pres, String outPath, IPdfOptions options)

Converts Presentation to PDF.


Presentation pres = new Presentation("input.pptx");
 try {
     PdfOptions pdfOptions = new PdfOptions();
     pdfOptions.setCompliance(PdfCompliance.PdfUa);
     Convert.toPdf(pres, "output.pdf", pdfOptions);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationInput presentation
outPathjava.lang.StringOutput path
optionsIPdfOptionsOutput PDF options

toSvg(String presPath)

public static void toSvg(String presPath)

Converts Presentation to SVG.


Convert.toSvg("pres.pptx");

Parameters:

ParameterTypeDescription
presPathjava.lang.StringPath of the input presentation

toSvg(String presPath, Convert.GetOutPathCallback getOutPath)

public static void toSvg(String presPath, Convert.GetOutPathCallback getOutPath)

Converts Presentation to SVG.


Convert.toSvg("pres.pptx", (slide, index) -> String.format("pres_%d-out.svg", index));

Parameters:

ParameterTypeDescription
presPathjava.lang.StringPath of the input presentation
getOutPathGetOutPathCallbackCallback that returns the SVG output path for each slide in the presentation

toSvg(Presentation pres, Convert.GetOutPathCallback getOutPath)

public static void toSvg(Presentation pres, Convert.GetOutPathCallback getOutPath)

Converts Presentation to SVG.


Presentation pres = new Presentation("input.pptx");
 try {
     Convert.toSvg(pres, (slide, index) -> String.format("pres_%d-out.svg", index));
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationInput presentation
getOutPathGetOutPathCallbackCallback that returns the SVG output path for each slide in the presentation

toSvg(Presentation pres, ISVGOptions options)

public static void toSvg(Presentation pres, ISVGOptions options)

Converts Presentation to SVG.


Presentation pres = new Presentation("input.pptx");
 try {
     SVGOptions svgOptions = new SVGOptions();
     svgOptions.setVectorizeText(true);
     Convert.toSvg(pres, svgOptions);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationInput presentation
optionsISVGOptionsSVG export options

toSvg(Presentation pres, Convert.GetOutPathCallback getOutPath, ISVGOptions options)

public static void toSvg(Presentation pres, Convert.GetOutPathCallback getOutPath, ISVGOptions options)

Converts Presentation to SVG.


Presentation pres = new Presentation("input.pptx");
 try {
     SVGOptions svgOptions = new SVGOptions();
     svgOptions.setVectorizeText(true);
     Convert.toSvg(pres, (slide, index) -> String.format("pres_%d-out.svg", index), svgOptions);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationInput presentation
getOutPathGetOutPathCallbackCallback that returns the SVG output path for each slide in the presentation
optionsISVGOptionsSVG export options

toJpeg(Presentation pres, String outputFileName)

public static void toJpeg(Presentation pres, String outputFileName)

Converts the input presentation to a set of JPEG format images. If the output file name is given as “myPath/myFilename.jpeg”, the result will be saved as a set of “myPath/myFilename_N.jpeg” files, where N is a slide number.


Presentation pres = new Presentation("pres.pptx");
 try {
     Convert.toJpeg(pres, "presImage.jpeg");
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationThe input presentation.
outputFileNamejava.lang.StringThe output file name.

toJpeg(Presentation pres, String outputFileName, Dimension imageSize)

public static void toJpeg(Presentation pres, String outputFileName, Dimension imageSize)

Converts the input presentation to a set of JPEG format images. If the output file name is given as “myPath/myFilename.jpeg”, the result will be saved as a set of “myPath/myFilename_N.jpeg” files, where N is a slide number.


Presentation pres = new Presentation("pres.pptx");
 try {
     Convert.toJpeg(pres, "presImage.jpeg", new Dimension(720, 540));
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationThe input presentation
outputFileNamejava.lang.StringThe output file name.
imageSizejava.awt.DimensionThe size of each generated image.

toJpeg(Presentation pres, String outputFileName, float scale, IRenderingOptions options)

public static void toJpeg(Presentation pres, String outputFileName, float scale, IRenderingOptions options)

Converts the input presentation to a set of JPEG format images. If the output file name is given as “myPath/myFilename.jpeg”, the result will be saved as a set of “myPath/myFilename_N.jpeg” files, where N is a slide number.


NotesCommentsLayoutingOptions notesOptions = new NotesCommentsLayoutingOptions();
 notesOptions.setNotesPosition(NotesPositions.BottomTruncated);
 IRenderingOptions options = new RenderingOptions();
 options.setSlidesLayoutOptions(notesOptions);

 Presentation pres = new Presentation("pres.pptx");
 try {
     Convert.toJpeg(pres, "presImage.jpeg", 2f, options);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationThe input presentation.
outputFileNamejava.lang.StringThe output file name.
scalefloatThe scaling factor applied to the output images relative to the original slide size.
optionsIRenderingOptionsThe rendering options.

toPng(Presentation pres, String outputFileName)

public static void toPng(Presentation pres, String outputFileName)

Converts the input presentation to a set of PNG format images. If the output file name is given as “myPath/myFilename.png”, the result will be saved as a set of “myPath/myFilename_N.png” files, where N is a slide number.


Presentation pres = new Presentation("pres.pptx");
 try {
     Convert.toPng(pres, "presImage.png");
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationThe input presentation.
outputFileNamejava.lang.StringThe output file name.

toPng(Presentation pres, String outputFileName, Dimension imageSize)

public static void toPng(Presentation pres, String outputFileName, Dimension imageSize)

Converts the input presentation to a set of PNG format images. If the output file name is given as “myPath/myFilename.png”, the result will be saved as a set of “myPath/myFilename_N.png” files, where N is a slide number.


Presentation pres = new Presentation("pres.pptx");
 try {
     Convert.toPng(pres, "presImage.png", new Dimension(720, 540));
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationThe input presentation
outputFileNamejava.lang.StringThe output file name.
imageSizejava.awt.DimensionThe size of each generated image.

toPng(Presentation pres, String outputFileName, float scale, IRenderingOptions options)

public static void toPng(Presentation pres, String outputFileName, float scale, IRenderingOptions options)

Converts the input presentation to a set of PNG format images. If the output file name is given as “myPath/myFilename.png”, the result will be saved as a set of “myPath/myFilename_N.png” files, where N is a slide number.


NotesCommentsLayoutingOptions notesOptions= new NotesCommentsLayoutingOptions();
 notesOptions.setNotesPosition(NotesPositions.BottomTruncated);
 IRenderingOptions options = new RenderingOptions();
 options.setSlidesLayoutOptions(notesOptions);

 Presentation pres = new Presentation("pres.pptx");
 try {
     Convert.toPng(pres, "presImage.png", 2f, options);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationThe input presentation.
outputFileNamejava.lang.StringThe output file name.
scalefloatThe scaling factor applied to the output images relative to the original slide size.
optionsIRenderingOptionsThe rendering options.

toTiff(Presentation pres, String outputFileName)

public static void toTiff(Presentation pres, String outputFileName)

Converts the input presentation to a set of TIFF format images. If the output file name is given as “myPath/myFilename.tiff”, the result will be saved as a set of “myPath/myFilename_N.tiff” files, where N is a slide number.


Presentation pres = new Presentation("pres.pptx");
 try {
     Convert.toTiff(pres, "presImage.tiff");
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationThe input presentation.
outputFileNamejava.lang.StringThe output file name.

toTiff(Presentation pres, String outputFileName, ITiffOptions options, boolean multipage)

public static void toTiff(Presentation pres, String outputFileName, ITiffOptions options, boolean multipage)

Converts the input presentation to TIFF format with custom options. If the output file name is given as “myPath/myFilename.tiff” and multipage is false, the result will be saved as a set of “myPath/myFilename_N.tiff” files, where N is a slide number. Otherwise, if multipage is true, the result will be a multi-page “myPath/myFilename.tiff” document.


NotesCommentsLayoutingOptions notesOptions= new NotesCommentsLayoutingOptions();
 notesOptions.setNotesPosition(NotesPositions.BottomTruncated);
 ITiffOptions options = new TiffOptions();
 options.setCompressionType(TiffCompressionTypes.CCITT3);
 options.setSlidesLayoutOptions(notesOptions);

 Presentation pres = new Presentation("pres.pptx");
 try {
     Convert.toTiff(pres, "pres.tiff", options, false);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
presPresentationThe input presentation.
outputFileNamejava.lang.StringThe output file name.
optionsITiffOptionsThe TIFF saving options.
multipagebooleanSpecifies whether the generated TIFF document should be a multi-page.