Convert
Inheritance: java.lang.Object
public class Convert
Represents a group of methods intended to convert Presentation.
Convert.AutoByExtension("pres.pptx", "pres.pdf");
Constructors
| Constructor | Description |
|---|---|
| Convert() |
Methods
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:
| Parameter | Type | Description |
|---|---|---|
| presPath | java.lang.String | Path of the input presentation |
| outPath | java.lang.String | Output 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:
| Parameter | Type | Description |
|---|---|---|
| presPath | java.lang.String | Path of the input presentation |
| outPath | java.lang.String | Output 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:
| Parameter | Type | Description |
|---|---|---|
| presPath | java.lang.String | Path of the input presentation |
| outPath | java.lang.String | Output path |
| options | IPdfOptions | Output 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | Input presentation |
| outPath | java.lang.String | Output 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | Input presentation |
| outPath | java.lang.String | Output path |
| options | IPdfOptions | Output PDF options |
toSvg(String presPath)
public static void toSvg(String presPath)
Converts Presentation to SVG.
Convert.toSvg("pres.pptx");
Parameters:
| Parameter | Type | Description |
|---|---|---|
| presPath | java.lang.String | Path 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:
| Parameter | Type | Description |
|---|---|---|
| presPath | java.lang.String | Path of the input presentation |
| getOutPath | GetOutPathCallback | Callback 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | Input presentation |
| getOutPath | GetOutPathCallback | Callback 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | Input presentation |
| options | ISVGOptions | SVG 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | Input presentation |
| getOutPath | GetOutPathCallback | Callback that returns the SVG output path for each slide in the presentation |
| options | ISVGOptions | SVG 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | The input presentation. |
| outputFileName | java.lang.String | The 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | The input presentation |
| outputFileName | java.lang.String | The output file name. |
| imageSize | java.awt.Dimension | The 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | The input presentation. |
| outputFileName | java.lang.String | The output file name. |
| scale | float | The scaling factor applied to the output images relative to the original slide size. |
| options | IRenderingOptions | The 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | The input presentation. |
| outputFileName | java.lang.String | The 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | The input presentation |
| outputFileName | java.lang.String | The output file name. |
| imageSize | java.awt.Dimension | The 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | The input presentation. |
| outputFileName | java.lang.String | The output file name. |
| scale | float | The scaling factor applied to the output images relative to the original slide size. |
| options | IRenderingOptions | The 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | The input presentation. |
| outputFileName | java.lang.String | The 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:
| Parameter | Type | Description |
|---|---|---|
| pres | Presentation | The input presentation. |
| outputFileName | java.lang.String | The output file name. |
| options | ITiffOptions | The TIFF saving options. |
| multipage | boolean | Specifies whether the generated TIFF document should be a multi-page. |