PHP में प्रस्तुतियों को HTML5 में बदलें

अवलोकन

यह लेख Aspose.Slides का उपयोग करके PowerPoint प्रस्तुतियों को HTML5 में बदलने की प्रक्रिया समझाता है। यह वेब एक्सटेंशन या अतिरिक्त निर्भरताओं के बिना बुनियादी HTML5 निर्यात, तथा शैप एनीमेशन और स्लाइड ट्रांज़िशन को नियंत्रित करने के विकल्पों को कवर करता है। लेख मानक PowerPoint‑to‑HTML निर्यात प्रक्रिया को भी दर्शाता है, स्लाइड व्यू मोड में HTML5 आउटपुट उत्पन्न करने की विधि बताता है, और लेआउट को कॉन्फ़िगर करके निर्यात दस्तावेज़ में टिप्पणी शामिल करने का तरीका दिखाता है।

PowerPoint को HTML5 में निर्यात करें

यह PHP कोड दर्शाता है कि आप वेब एक्सटेंशन और निर्भरताओं के बिना प्रस्तुति को HTML5 में कैसे निर्यात कर सकते हैं:

  $pres = new Presentation("pres.pptx");
  try {
    $pres->save("pres.html", SaveFormat::Html5);
  } finally {
    if (!java_is_null($pres)) {
      $pres->dispose();
    }
  }

आप इस प्रकार शैप एनीमेशन और स्लाइड ट्रांज़िशन की सेटिंग्स निर्दिष्ट करना चाहेंगे:

  $pres = new Presentation("pres.pptx");
  try {
    $html5Options = new Html5Options();
    $html5Options->setAnimateShapes(false);
    $html5Options->setAnimateTransitions(false);
    $pres->save("pres5.html", SaveFormat::Html5, $html5Options);
  } finally {
    if (!java_is_null($pres)) {
      $pres->dispose();
    }
  }

PowerPoint को HTML में निर्यात करें

यह Java कोड मानक PowerPoint से HTML निर्यात प्रक्रिया को दर्शाता है:

  $pres = new Presentation("pres.pptx");
  try {
    $pres->save("pres.html", SaveFormat::Html);
  } finally {
    if (!java_is_null($pres)) {
      $pres->dispose();
    }
  }

इस मामले में, प्रस्तुति सामग्री SVG के माध्यम से इस रूप में रेंडर की जाती है:

<body>
<div class="slide" name="slide" id="slideslideIface1">
     <svg version="1.1">
         <g> THE SLIDE CONTENT GOES HERE </g>
     </svg>
</div>
</body>
```php

Export PowerPoint to HTML5 Slide View

Aspose.Slides allows you to convert a PowerPoint presentation to an HTML5 document in which the slides are presented in a slide view mode. In this case, when you open the resulting HTML5 file in a browser, you see the presentation in slide view mode on a web page.

This PHP code demonstrates the PowerPoint to HTML5 Slide View export process:

  $pres = new Presentation("pres.pptx");
  try {
    $html5Options = new Html5Options();
    $html5Options->setAnimateShapes(true);
    $html5Options->setAnimateTransitions(true);
    $pres->save("HTML5-slide-view.html", SaveFormat::Html5, $html5Options);
  } finally {
    if (!java_is_null($pres)) {
      $pres->dispose();
    }
  }

Convert Presentations to HTML5 Documents with Comments

Comments in PowerPoint are a tool that allows users to leave notes or feedback on presentation slides. They are especially useful in collaborative projects, where multiple people can add their suggestions or remarks to specific slide elements without altering the main content. Each comment shows the author’s name, making it easy to track who left the remark.

Let’s say we have the following PowerPoint presentation saved in the “sample.pptx” file.

Two comments on the presentation slide

When you convert a PowerPoint presentation to an HTML5 document, you can easily specify whether to include comments from the presentation in the output document. To do this, you need to specify the display parameters for comments in the getNotesCommentsLayouting method of the Html5Options class.

The following code example converts a presentation to an HTML5 document with comments displayed to the right of the slides.

$html5Options = new Html5Options();
$html5Options->getNotesCommentsLayouting()->setCommentsPosition(CommentsPositions::Right);

$presentation = new Presentation("sample.pptx");
$presentation->save("output.html", SaveFormat::Html5, $html5Options);
$presentation->dispose();

"output.html" दस्तावेज़ नीचे दर्शाए गए चित्र में दिखाया गया है।

![आउटपुट HTML5 दस्तावेज़ में टिप्पणियाँ](two_comments_html5.png)

## **अक्सर पूछे जाने वाले प्रश्न**

**क्या मैं नियंत्रित कर सकता हूँ कि ऑब्जेक्ट एनीमेशन और स्लाइड ट्रांज़िशन HTML5 में चलेंगे या नहीं?**

हाँ, HTML5 अलग-अलग विकल्प प्रदान करता है [शेप एनीमेशन]({{guid1}}) और [स्लाइड ट्रांज़िशन]({{guid2}}) को सक्षम या अक्षम करने के लिए।

**क्या टिप्पणी का आउटपुट समर्थित है, और उन्हें स्लाइड के सापेक्ष कहाँ रखा जा सकता है?**

हाँ, टिप्पणियाँ HTML5 में जोड़ी जा सकती हैं और [लेआउट सेटिंग्स]({{guid3}}) के माध्यम से (उदाहरण के लिए, स्लाइड के दाएँ) स्थित की जा सकती हैं।

**क्या मैं सुरक्षा या CSP कारणों से JavaScript को कॉल करने वाले लिंक्स को छोड़ सकता हूँ?**

हाँ, एक [सेटिंग]({{guid4}}) है जो आपको सहेजते समय JavaScript कॉल वाले हाइपरलिंक्स को छोड़ने की अनुमति देती है। यह कड़े सुरक्षा नीतियों का पालन करने में मदद करता है।