PhpPowerpoint set slide width and height (slide dimensions)

can i change the size of only one slide in powerpoint?
powerpoint slide dimensions 2020
powerpoint slide dimensions pixels
powerpoint slide size change
how to change slide size in powerpoint 2010
powerpoint 16:9 pixel size
how to change slide size in google slides
powerpoint slide size photoshop

I want to know if there is a way to create a ppt file with pre defined width and height rather than default one.

I've used this code to set it for the new PHPPresentation (newer PHPPowerpoint version). Hope it helps..(replace path's with your phppresentation path's and width(1180) and height(768) to suit yours

/*Standard library loaders */
require_once  'include/Common/src/Common/Autoloader.php';
\PhpOffice\Common\Autoloader::register();

require_once 'include/PHPPowerPoint2/src/PhpPresentation/Autoloader.php';

\PhpOffice\PhpPresentation\Autoloader::register();
/*Standard library loaders */

use PhpOffice\PhpPresentation\PhpPresentation;

use PhpOffice\PhpPresentation\DocumentLayout;


$objPHPPowerPoint = new PhpPresentation();

$objPHPPowerPoint->getLayout()->setDocumentLayout(DocumentLayout::LAYOUT_CUSTOM, true)
->setCX( 1180,  DocumentLayout::UNIT_PIXEL)
->setCY( 768,  DocumentLayout::UNIT_PIXEL);

How to Change Slide Size in PowerPoint?, I've used this code to set it for the new PHPPresentation (newer PHPPowerpoint version). Hope it helps..(replace path's with your phppresentation path's and� In the Height and Width boxes, enter the desired dimensions. The measurement unit is determined by your computer's operating system. The limits are: Minimum width/height: 1 inch (2.54 cm/120 px) Maximum width: 56 inches (142.24 cm/720 px) Click Ok. PC Office 2013, 2016. To change slide size in PowerPoint 2013 or 2016, do the following:

The answer of @user2633993 is still valid, though the code for setting the layout width and height has changed a bit, now you need to set an array containing the cx and cy keys, their values doesn't matter.

So the code needs to look something like this:

$objPHPPowerPoint->getLayout()->setDocumentLayout(['cx' => 1280, 'cy' => 700], true)
        ->setCX(1280, DocumentLayout::UNIT_PIXEL)
        ->setCY(700, DocumentLayout::UNIT_PIXEL);`

Change the size of your slides - Office Support, Custom: In the Height and Width boxes, enter the desired dimensions. The measurement unit is determined by your computer's operating system. Set the dimensions of your PowerPoint slide first by opening Design > Slide Size. This is the best way to avoid re-work while working with PowerPoint slide sizes. Set your PowerPoint dimensions first! 2. Use the PowerPoint Rulers. Many presenters (myself included) use PowerPoint to create printed, products too.

you can set width and height:

Please see this tutorial

$objPHPPowerPoint = new PHPPowerPoint();
$currentSlide = $objPHPPowerPoint->getActiveSlide();
$shape = $currentSlide->createDrawingShape();
$shape = $currentSlide->createRichTextShape();
$shape->setHeight(300);
$shape->setWidth(600);
$shape->setOffsetX(170);
$shape->setOffsetY(180);
$shape->getAlignment()->setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_CENTER );
$textRun = $shape->createTextRun('Thank you for using PHPPowerPoint!');
$textRun->getFont()->setBold(true);
$textRun->getFont()->setSize(60);
$textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFC00000' ) );
$objWriter = PHPPowerPoint_IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007');
$objWriter->save(str_replace('.php', '.pptx', __FILE__));

What Are the Right Dimensions (Size) for Your PowerPoint PPT , Select Standard (4:3 aspect ratio) or Widescreen (16:9) or Custom Slide Size. Choose custom dimensions (in inches, centimeters, or pixels). On the Design� Returns or sets the slide width, in points. Read/write. Syntax. expression. SlideWidth. expression A variable that represents a PageSetup object. Return value. Single. Example. This example sets the slide height to 8.5 inches and the slide width to 11 inches for the active presentation.

In the newest version (v0.9.0) you don't need to set the array as @user2962785 mentioned anymore. The following will suffice (example is for A0 portrait format)

$objPHPPowerPoint->getLayout()
                 ->setCX(841, DocumentLayout::UNIT_MILLIMETER)
                 ->setCY(1189, DocumentLayout::UNIT_MILLIMETER);

How to Change Slide Size in Powerpoint, Choosing the correct dimensions for your PowerPoint slide size depends shape or aspect ratio that describes the width versus height of the screen. Let's talk about the most common sizes to set your PowerPoint slides to. Slide Dimensions. Okay, so when you open PowerPoint and start a new presentation, your slide size is set to the default which is 10 inches by 7.5 inches. This is also 1024 x 768 pixels at 96dpi. There are ways to widen the slide, make it smaller, and customize the dimensions to fit exactly what you’re looking for.

How to Change The Size of a Slide in Microsoft PowerPoint, If you want to print out or display your PowerPoint slides in a bigger or or set your slide dimensions manually using the “Width” and “Height”� However, everything has long since changed. Widescreen is now the standard presentation format, and since the 2013 version of PowerPoint, the default slide size has been set to a 16:9 widescreen aspect ratio. However, you can still switch back to the 4:3 setting, or even set your own custom size.

SiteMap, To change the PowerPoint slide dimension, you will first of all want to choose the default PowerPoint slide size setting for all slides in the application. by saying that a widescreen slide is 78% larger in width than in height. Notice too, how much wider the 16:9 slide size is versus the 4:3 slide size in the picture below. The new size gives you more room for the content on your slides. When you are converting an existing presentation to a new slide size, you will additionally be given the following prompt: “You are scaling to a new slide size.

How to change the slide size from 4:3 to 16:9 � Issue #474 , Dismiss. Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and� To select a preset slide size, select a preset size from the “Slides sized for:” drop-down. To create custom slide sizes, enter custom measurements into the “Width:” and “Height:” spinner boxes. If you want to change the starting slide numbering, enter the starting slide number into the “Number slides from:” spinner box.

Comments
  • Please would you show what you have tried?
  • Have you checked PHPPowerPoint_DocumentLayout::setDocumentLayout, PHPPowerPoint_DocumentLayout::setLayoutXmilli or PHPPowerPoint_DocumentLayout::setLayoutYmilli? Their source code can be found here
  • @h2oooo Thank you it worked
  • This has nothing to do with PHPPowerpoint though.