Forum


Replies: 15   Views: 260
Import a style / easy template
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 N. Bidniss  · 18-03-2024 - 16:02

Looking at buying.

I have a specific style I need to use: Title, a text block on the left and an image on the right. Specific background colors, fonts, etc.

A footer under the image.

Do you have a template for that? In essence, I simple add my text, image, and footer?

More than willing to pay/purchase however the api seems too low level for get the professional look I'm seeking ... I've a SaaS product to maintain, and don't have time to learn the entire API

Please let me know which example can import an existing pptx file and allow me to make these simple changes

If I can see it working, then I will purchase right away ... we need to get our SaaS tool output into a PowerPoint.

-N.B.

 

Posted by admin  · 18-03-2024 - 18:51

Hello,

phppptx can create PPTX presentations from scratch or using templates.

We recommend you read the Practical guide, where you can read the first steps using phppptx and some samples. For example, Working with templates to learn how to open a PPTX template and replace contents.

On the API documentation and the package you can find samples using each method.

Regards.

Posted by N. Bidniss  · 19-03-2024 - 14:00

Getting this error on the trial:

PowerPoint found a problem with content in client_v1.pptx.
PowerPoint can attempt to repair the presentation.

If you trust the source of this presentation, click Repair.

Saved with Powerpoint to repair, on open it continues to display the error and ask if I want to repair.

Any thoughts?

Posted by N. Bidniss  · 19-03-2024 - 14:45

Deleted by N. Bidniss · 19-03-2024 - 14:58

Posted by admin  · 19-03-2024 - 17:16

Hello,

What program have you used to generate and open the PPTX template? Please check the program you are using creates valid PPTX files to be used with phppptx.

W recommend you check and run the samples included in the package (examples folder).

For further support we'd need to check your PPTX template and the phppptx code you are running. Please note that this kind of support isn't available in the trial package. If you purchase a license, please send the PPTX you are using and the phppptx code you are running to contact[at]phpdocx.com and we'll check them.

Regards.

Posted by N. Bidniss  · 20-03-2024 - 13:15

I'm using Mac Microsoft PowerPoint. Since removing all unused fonts from the template it's working well. Happy. Another questions, can you explain the "removeAfterDownload" use case? I am able to download, and am unsure of its function (or why I would want to remove it as I just downloaded it. I know I'm missing something obvious...

Posted by admin  · 20-03-2024 - 14:48

Hello,

The removeAfterDownload option deletes the PPTX file from the file system of the server.

savePptxAndDownload generates a PPTX file in the file system of the server where PHP runs and downloads the PPTX in the browser you are using. The file generated in the server isn't removed unless you delete it manually or enable the removeAfterDownload option included in this method.

Regards.

Posted by N. Bidniss  · 20-03-2024 - 17:38

Ah, of course. Thank you. Will be buying! It took me a while to understand that one had to use the internal selection names of PowerPoint objects (I didn't even know where\how to find them or what they were called.) The library works really well, very fast, and meets all of my requirements.

Posted by admin  · 20-03-2024 - 17:44

Hello,

You can use getActiveSlideInformation (https://www.phppptx.com/documentation/api-documentation/layouts-settings/get-active-slide-information-pptx) to get the existing layout placeholders from a slide. This method is available in all licenses. On the practical guide is fully detailed the use of this method:

Indexer can also extract information from a PPTX such as layouts. But this method is only available in Advanced and Premium licenses.

Please note that trial package includes the Basic license features (adding trial watermarks).
Advanced and Premium licenses include many extra features: https://www.phppptx.com/features

For example a stream mode to generate PPTX files without creating a file in the fs (https://www.phppptx.com/documentation/api-documentation/performance/zip-stream-pptx).

Regards.

Posted by N. Bidniss  · 20-03-2024 - 21:07

Thank you. One last question, and I appreciate your help. I recall seeing how to add a note but I cannot find that demo or code now. I've spent a couple hours looking across the site. Could you please share the code to insert/add a note? (not a comment, but text into the notes section.)

 

Best,

 

Posted by admin  · 21-03-2024 - 07:29

Hello,

The current stable version of phppptx doesn't support adding notes. It's a work in progress that will be added in a future release of the library.

Regards.

Posted by N. Bidniss  · 24-03-2024 - 14:20

Hello, I've got the library working in dev. I could use your help now. When I try to use on the production server for final testing before purchase, I get no pptx created, and this log:

[24-Mar-2024 09:47:29 America/New_York] PHP Warning:  require_once(/home/bsmnfkww/public_html/export/examples/Contents/addText/../../../classes/CreatePptx.php): failed to open stream: No such file or directory in /home/bsmnfkww/public_html/export/examples/Contents/addText/sample_1.php on line 4

[24-Mar-2024 09:47:29 America/New_York] PHP Fatal error:  require_once(): Failed opening required '/home/bsmnfkww/public_html/export/examples/Contents/addText/../../../classes/CreatePptx.php' (include_path='.:/opt/alt/php74/usr/share/pear') in /home/bsmnfkww/public_html/export/examples/Contents/addText/sample_1.php on line 4

 

Here are the check.php results - all green

 

PHP_VERSION: 7.4.33
PHP_OS: Linux
PHP_UNAME: Linux server106.web-hosting.com 2.6.32-954.3.5.lve1.4.93.el6.x86_64 #1 SMP Wed Oct 4 17:04:29 UTC 2023 x86_64
SERVER_NAME: dexsights.com
SERVER_SOFTWARE: LiteSpeed
SERVER_ADDR: 68.65.120.234
SERVER_PROTOCOL: HTTP/1.1
HTTP_HOST: dexsights.com
HTTP_X_FORWARDED_FOR: 67.253.44.8,162.158.155.20
PHP_SELF: /export/check.php
ZipArchive: 1
DomDocument: 1
SimpleXMLElement: 1
Tidy: 1
mbstring: 1

Config file:
[settings]
; right to left languages config
;rtl = "true"

; if true, generate the PPTX as stream instead of saving it to the file system. Only available for Premium licenses
;stream="true"

[license]
; phppptx license code
code = ""
; subdomain (Basic license), domain (Advanced license) or IP (Premium license)
value = ""

[transform]
; transform options. Only available for Advanced and Premium licenses

; libreoffice, mspowerpoint
;method = "libreoffice"

; libreoffice installation path, absolute path
;path = "/opt/libreoffice/program/soffice"

; custom HOME folder; allows setting a custom HOME folder when doing the transformations using LibreOffice
;home_folder = ""

 

Thanks in advance.

Posted by admin  · 24-03-2024 - 20:27

Hello,

Please note the error you get:

PHP Fatal error:  require_once(): Failed opening required '/home/bsmnfkww/public_html/export/examples/Contents/addText/../../../classes/CreatePptx.php'

is a PHP error, not a phppptx error. That PHP error appears when the PHP file you are including (witn include/include_once or require/require_once functions) can't be read/opened. We recommend you check you have copied the classes folder to the correct path (and all files) and all PHP files have the correct rwx permissions.

Regards.

Posted by N. Bidniss  · 24-03-2024 - 23:43

The paths are all good. It seems every attempt to upload CreatePptx.php to the server fails as follows.

It gets uploaded and instantly gets deleted.

Not by me or anything I'm doing—I've got 25+ years LAMP stack experience and I've never seen this outside of some hosting security system.

Runs fine on DEV, entire app runs file and all the other files in PHPPPTX are there. Only CreatePptx.php is getting deleted on upload.

Any thoughts?

 

Posted by N. Bidniss  · 25-03-2024 - 00:36

CreatePptx.php has an encoded file, that thus they cannot whitelist it. I imagine its your file locking/security/ licensing. Not sure how to proceed. Invested quite a bit of time in this. Any toughts? Have you had this problem before?

 

Posted by admin  · 25-03-2024 - 06:35

Hello,

Only the trial package includes enconded/obfuscated contents to add trial watermarks. Purchase licenses don't included enconded/obfuscated contents nor trial watermarks.

We recommend you test the trial package on your dev server and purchase a license to use phppptx on the production server.

Regards.