Converting Presentation to XPS in PHP

Aspose.Slides - Converting Presentation to XPS with default size

To convert presentation to XPS with default size using Aspose.Slides Java for Ruby, simply invoke convert_with_default_size method of ConvertingToXps module. Here you can see example code.

PHPCode


 public static function convert_with_default_size($dataDir=null)

{

\# Instantiate a Presentation object that represents a PPTX file

$pres = new Presentation($dataDir . "Aspose.pptx");

\# Saving the presentation to XPS format

$save_format = new SaveFormat();

$pres->save($dataDir . "Aspose.xps", $save_format->Xps);

print "Document has been converted, please check the output file.";

}

Aspose.Slides - Converting Presentation to XPS with custom size

To convert presentation to XPS with custom size using Aspose.Slides Java for PHP, simply invoke convert_with_custom_size method of ConvertingToXps module. Here you can see example code.

PHPCode


 public static function convert_with_custom_size($dataDir=null)

{

\# Instantiate a Presentation object that represents a PPTX file

$pres = new Presentation($dataDir . "Aspose.pptx");

\# Instantiate the TiffOptions class

$opts = new XpsOptions();

\# Save MetaFiles as PNG

$opts->SaveMetafilesAsPng = true;

\# Save the presentation to TIFF with specified image size

$save_format = new SaveFormat();

$pres->save($dataDir . "Aspose-Custom-Size.xps", $save_format->Xps, $opts);

print "Document has been converted, please check the output file.";

}

Download Running Code

Download Converting Presentation to XPS (Aspose.Slides) from any of the below mentioned social coding sites: