Convert HTML to JPG in C++
Convert HTML files to JPG images using Aspose.Slides for C++ without Microsoft PowerPoint.
Convert HTML to JPG in C++
Aspose.Slides for C++ is a presentation processing API that can import HTML content and render slides as JPG images.
Aspose.Slides for C++ can convert HTML content to JPG images and other presentation-related formats.
Convert HTML to JPG Using C++
To convert HTML to JPG, create a Presentation from the HTML file and save each slide as a JPG image.
C++ code for converting HTML into JPG
auto presentation = MakeObject<Presentation>();
presentation->get_Slides()->RemoveAt(0);
auto htmlStream = File::OpenRead(u"page.html");
presentation->get_Slides()->AddFromHtml(htmlStream);
htmlStream->Dispose();
auto slideCount = presentation->get_Slides()->get_Count();
for (int index = 0; index < slideCount; index++)
{
auto slide = presentation->get_Slide(index);
auto fileName = String::Format(u"slide_{0}.jpg", index);
auto image = slide->GetImage();
image->Save(fileName);
image->Dispose();
}
presentation->Dispose();
How to Convert HTML to JPG Using Aspose.Slides for C++ API
These are the steps to convert HTML to JPG in C++.
Install Aspose.Slides for C++ .
Add a library reference (import the library) to your C++ project.
Open the source HTML file in C++.
Save the result as a JPG file.
Free Online Converter
Convert presentations and slides online.
Convert HTML to Other Supported Formats
You can also convert HTML and save it to other file formats. See all supported formats below.