Forum


Replies: 1   Views: 127
A few questions from a possible user.
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phppptx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phppptx version and check the Documentation available.

Posted by admin  · 31-07-2024 - 17:10

Hello,

Please check our answers below:

  • On the addHtml API page, you can read the supported HTML tags and CSS styles. Please note that PPTX files don't support as many content types and styles as DOCX documents because PPTX doesn't support them or they haven't been added in the current stable version. New phppptx stable releases support new HTML tags and CSS styles, and a future release of phppptx will include HTML Extended and CSS Extended as phpdocx includes.

Please note that br tags are supported when transforming HTML to PPTX to do line breaks. From the sample Content s/addHtml/sample_1.php included in the package:

$html = '<style>
    p {
        font-family: Arial;
        font-style: italic;
        text-decoration: underline;
        color: #2CA87A;
    }
</style>
<p>Lorem ipsum with <br>Arial font</p>';
$pptx->addHtml($html, array('placeholder' => array('name' => 'Subtitle 2')));
  • replaceVariablePptxFragment only works with text contents generated with addText (and other methods that generate text contents such as addHtml). Images can't be added using a PptxFragment because these contents require setting a position in a slide. We recommend you check the samples included in the package.

Please note that PPTX contents don't work in the same way as DOCX contents. PPTX contents have some limitations and restrictions, for example, images (and other contents such as videos, audios, tables...) must be added in their own shapes (text and many content types can't be mixed in the same shape). To add images you can use addImage to add new images or replaceVariableImage to replace placeholder images, but a text placeholder can't be replaced with an image. Instead of adding multiple placeholders, you can use addImage as many times as needed.

Regards.