PDF Document Conversion via JavaScript via C++
Export PDF to Microsoft Office® Word, Excel, PowerPoint Presentations, Images, EPUB and fixed-layout formats
Overview
Are you searching for a method to transform PDF files into other formats using JavaScript and C++? Aspose.PDF for JavaScript via C++ is the perfect solution for converting PDF documents. This article will demonstrate how to convert PDF to text using JavaScript via C++. PDF files can include various content, such as text, images, clickable buttons, hyperlinks, embedded fonts, signatures, and stamps. When converting a PDF file to another format, users often want to be able to edit the PDF content. With Aspose.PDF for JavaScript via C++, you can easily and quickly convert your PDF documents to and from the most popular formats. Our library ensures that your PDF files are converted accurately and successfully.
PDF to DOC Conversion
Aspose.PDF for JavaScript supports PDF to DOC conversion directly on the Web. First, we create ‘FileReader’. Then, we call the AsposePdfToDoc function. The web worker is set up to listen for messages using the onmessage event handler. When it receives a message from the web page, it processes the request and sends a response back to the main thread. The resultant file we can become by Download File Function. The DownloadFile function is responsible for generating a link that allows the user to download a file. Next, if the ‘json.errorCode’ is 0, then json.fileNameResult will contain the name you specified earlier. If the ‘json.errorCode’ parameter is not equal to 0 and, accordingly, there will be an error in your file, then information about such an error will be contained in the ‘json.errorText’ property. The name of the resulting file is ‘ResultPDFtoDoc.doc’.
Save PDF as XLSX
This code is a JavaScript function that converts a PDF file to an Excel file using the Aspose.PDF. It takes an event object as a parameter, which contains the selected PDF file from a file input element. It creates a FileReader object and assigns a callback function to its onload event. The callback function is executed when the file is read as an array buffer. Next, call the AsposePdfToXlsX function. The function takes the file content, the original file name, and the output file name as arguments and returns a JSON object with the result. The JSON object has an errorCode property and an errorText property. If the errorCode is 0, it means that the conversion was successful and the JSON object also has a fileNameResult property, which contains the name of the output Excel file. If the errorCode is not 0, it means that there was an error. The name of the resulting file is ‘ResultPDFtoXlsX.xlsx’.
Convert PDF to PowerPoint Presentations
This code is a JavaScript function that converts a PDF file to a PowerPoint file using the Aspose.PDF. It takes an event object as a parameter, which contains the selected PDF file from a file input element. Next, creates a FileReader object and assigns a callback function to its onload event. The callback function is executed when the file is read as an array buffer.Call the AsposePdfToPptX function. The function takes the file content, the original file name, and the output file name as arguments and returns a JSON object with the result. The JSON object has an errorCode property and an errorText property. If the errorCode is 0, it means that the conversion was successful and the JSON object also has a fileNameResult property, which contains the name of the output PowerPoint file. If the errorCode is not 0, it means that there was an error and the errorText property contains the error message. As a result, the DownloadFile function creates a download link for the output PowerPoint file. The function takes the output file name ‘ResultPDFtoPptX.pptx’.
Portable Document Format PDF to EPUB Conversion
This code is a JavaScript function that converts a PDF file to an EPUB file using the Aspose.PDF. It creates a FileReader object and assigns a callback function to its onload event. Next, call the AsposePdfToEPUB function. The function takes the file content, the original file name, and the output file name as arguments and returns a JSON object with the result.The JSON object has an errorCode property and an errorText property. If the errorCode is 0, it means that the conversion was successful and the JSON object also has a fileNameResult property, which contains the name of the output EPUB file. If the errorCode is not 0, it means that there was an error and the errorText property contains the error message. As a result, the DownloadFile function creates a download link for the output EPUB file. The function takes the output file name ‘ResultPDFtoEPUB.epub’.
Convert PDF to PNG
This code is a JavaScript function that converts a PDF file to PNG images using the Aspose.PDF. It creates a FileReader object and assigns a callback function to its onload event. The callback function is executed when the file is read as an array buffer. Calls the AsposePdfPagesToPng function, which is a wrapper for the Aspose.PDF. The function takes the file content, the original file name, the output file name template, and the resolution as arguments and returns a JSON object with the result. The JSON object has an errorCode property and an errorText property. As a result, the DownloadFile function for each output file creates a download link for the PNG image. The function takes the output file name ‘ResultPdfToPng{0:D2}.png’.