Convert PDF to EPUB, TeX, Text, XPS in Node.js
Try to convert PDF to EPUB online
Aspose.PDF for Node.js presents you online free application “PDF to EPUB”, where you may try to investigate the functionality and quality it works.
Convert PDF to EPUB
EPUB is a free and open e-book standard from the International Digital Publishing Forum (IDPF). Files have the extension .epub. EPUB is designed for reflowable content, meaning that an EPUB reader can optimize text for a particular display device. EPUB also supports fixed-layout content. The format is intended as a single format that publishers and conversion houses can use in-house, as well as for distribution and sale. It supersedes the Open eBook standard.
In case you want to convert PDF document, you can use AsposePdfToEPUB function. Please check the following code snippet in order to convert in Node.js environment.
CommonJS:
- Call
require
and importasposepdfnodejs
module asAsposePdf
variable. - Specify the name of the PDF file that will be converted.
- Call
AsposePdf
as Promise and perform the operation for converting file. Receive the object if successful. - Call the function AsposePdfToEPUB.
- Convert PDF file. Thus, if ‘json.errorCode’ is 0, the result of the operation is saved in “ResultPDFtoEPUB.epub”. If the json.errorCode parameter is not 0 and, accordingly, an error appears in your file, the error information will be contained in ‘json.errorText’.
const AsposePdf = require('asposepdfnodejs');
const pdf_file = 'Aspose.pdf';
AsposePdf().then(AsposePdfModule => {
/*Convert a PDF-file to ePub and save the "ResultPDFtoEPUB.epub"*/
const json = AsposePdfModule.AsposePdfToEPUB(pdf_file, "ResultPDFtoEPUB.epub");
console.log("AsposePdfToEPUB => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
});
ECMAScript/ES6:
- Import the
asposepdfnodejs
module. - Specify the name of the PDF file that will be converted
- Initialize the AsposePdf module. Receive the object if successful.
- Call the function AsposePdfToEPUB.
- Convert PDF file. Thus, if ‘json.errorCode’ is 0, the result of the operation is saved in “ResultPDFtoEPUB.epub”. If the json.errorCode parameter is not 0 and, accordingly, an error appears in your file, the error information will be contained in ‘json.errorText’.
import AsposePdf from 'asposepdfnodejs';
const AsposePdfModule = await AsposePdf();
const pdf_file = 'Aspose.pdf';
/*Convert a PDF-file to ePub and save the "ResultPDFtoEPUB.epub"*/
const json = AsposePdfModule.AsposePdfToEPUB(pdf_file, "ResultPDFtoEPUB.epub");
console.log("AsposePdfToEPUB => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
Try to convert PDF to LaTeX/TeX online
Aspose.PDF for Node.js presents you online free application “PDF to LaTeX”, where you may try to investigate the functionality and quality it works.
Convert PDF to TeX
Aspose.PDF for Node.js support converting PDF to TeX. In case you want to convert PDF document, you can use AsposePdfToTeX function. Please check the following code snippet in order to convert in Node.js environment.
CommonJS:
- Call
require
and importasposepdfnodejs
module asAsposePdf
variable. - Specify the name of the PDF file that will be converted.
- Call
AsposePdf
as Promise and perform the operation for converting file. Receive the object if successful. - Call the function AsposePdfToTeX.
- Convert PDF file. Thus, if ‘json.errorCode’ is 0, the result of the operation is saved in “ResultPDFtoTeX.tex”. If the json.errorCode parameter is not 0 and, accordingly, an error appears in your file, the error information will be contained in ‘json.errorText’.
const AsposePdf = require('asposepdfnodejs');
const pdf_file = 'Aspose.pdf';
AsposePdf().then(AsposePdfModule => {
/*Convert a PDF-file to TeX and save the "ResultPDFtoTeX.tex"*/
const json = AsposePdfModule.AsposePdfToTeX(pdf_file, "ResultPDFtoTeX.tex");
console.log("AsposePdfToTeX => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
});
ECMAScript/ES6:
- Import the
asposepdfnodejs
module. - Specify the name of the PDF file that will be converted
- Initialize the AsposePdf module. Receive the object if successful.
- Call the function AsposePdfToTeX.
- Convert PDF file. Thus, if ‘json.errorCode’ is 0, the result of the operation is saved in “ResultPDFtoTeX.tex”. If the json.errorCode parameter is not 0 and, accordingly, an error appears in your file, the error information will be contained in ‘json.errorText’.
import AsposePdf from 'asposepdfnodejs';
const AsposePdfModule = await AsposePdf();
const pdf_file = 'Aspose.pdf';
/*Convert a PDF-file to TeX and save the "ResultPDFtoTeX.tex"*/
const json = AsposePdfModule.AsposePdfToTeX(pdf_file, "ResultPDFtoTeX.tex");
console.log("AsposePdfToTeX => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
Try to convert Convert PDF to Text online
Aspose.PDF for Node.js presents you online free application “PDF to Text”, where you may try to investigate the functionality and quality it works.
Convert PDF to TXT
In case you want to convert PDF document, you can use AsposePdfToTxt function. Please check the following code snippet in order to convert in Node.js environment.
CommonJS:
- Call
require
and importasposepdfnodejs
module asAsposePdf
variable. - Specify the name of the PDF file that will be converted.
- Call
AsposePdf
as Promise and perform the operation for converting file. Receive the object if successful. - Call the function AsposePdfToTxt.
- Convert PDF file. Thus, if ‘json.errorCode’ is 0, the result of the operation is saved in “ResultPDFtoTxt.txt”. If the json.errorCode parameter is not 0 and, accordingly, an error appears in your file, the error information will be contained in ‘json.errorText’.
const AsposePdf = require('asposepdfnodejs');
const pdf_file = 'Aspose.pdf';
AsposePdf().then(AsposePdfModule => {
/*Convert a PDF-file to Txt and save the "ResultPDFtoTxt.txt"*/
const json = AsposePdfModule.AsposePdfToTxt(pdf_file, "ResultPDFtoTxt.txt");
console.log("AsposePdfToTxt => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
});
ECMAScript/ES6:
- Import the
asposepdfnodejs
module. - Specify the name of the PDF file that will be converted
- Initialize the AsposePdf module. Receive the object if successful.
- Call the function AsposePdfToTxt.
- Convert PDF file. Thus, if ‘json.errorCode’ is 0, the result of the operation is saved in “ResultPDFtoTxt.txt”. If the json.errorCode parameter is not 0 and, accordingly, an error appears in your file, the error information will be contained in ‘json.errorText’.
import AsposePdf from 'asposepdfnodejs';
const AsposePdfModule = await AsposePdf();
const pdf_file = 'Aspose.pdf';
/*Convert a PDF-file to Txt and save the "ResultPDFtoTxt.txt"*/
const json = AsposePdfModule.AsposePdfToTxt(pdf_file, "ResultPDFtoTxt.txt");
console.log("AsposePdfToTxt => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
Try to convert PDF to XPS online
Aspose.PDF for Node.js presents you online free application “PDF to XPS”, where you may try to investigate the functionality and quality it works.
Convert PDF to XPS
The XPS file type is primarily associated with the XML Paper Specification by Microsoft Corporation. The XML Paper Specification (XPS), formerly codenamed Metro and subsuming the Next Generation Print Path (NGPP) marketing concept, is Microsoft’s initiative to integrate document creation and viewing into the Windows operating system.
Aspose.PDF for Node.js gives a possibility to convert PDF files to XPS format. Let try to use the presented code snippet for converting PDF files to XPS format with Node.js.
In case you want to convert PDF document, you can use AsposePdfToXps function. Please check the following code snippet in order to convert in Node.js environment.
CommonJS:
- Call
require
and importasposepdfnodejs
module asAsposePdf
variable. - Specify the name of the PDF file that will be converted.
- Call
AsposePdf
as Promise and perform the operation for converting file. Receive the object if successful. - Call the function AsposePdfToXps.
- Convert PDF file. Thus, if ‘json.errorCode’ is 0, the result of the operation is saved in “ResultPDFtoXps.xps”. If the json.errorCode parameter is not 0 and, accordingly, an error appears in your file, the error information will be contained in ‘json.errorText’.
const AsposePdf = require('asposepdfnodejs');
const pdf_file = 'Aspose.pdf';
AsposePdf().then(AsposePdfModule => {
/*Convert a PDF-file to Xps and save the "ResultPDFtoXps.xps"*/
const json = AsposePdfModule.AsposePdfToXps(pdf_file, "ResultPDFtoXps.xps");
console.log("AsposePdfToXps => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
});
ECMAScript/ES6:
- Import the
asposepdfnodejs
module. - Specify the name of the PDF file that will be converted.
- Initialize the AsposePdf module. Receive the object if successful.
- Call the function AsposePdfToXps.
- Convert PDF file. Thus, if ‘json.errorCode’ is 0, the result of the operation is saved in “ResultPDFtoXps.xps”. If the json.errorCode parameter is not 0 and, accordingly, an error appears in your file, the error information will be contained in ‘json.errorText’.
import AsposePdf from 'asposepdfnodejs';
const AsposePdfModule = await AsposePdf();
const pdf_file = 'Aspose.pdf';
/*Convert a PDF-file to Xps and save the "ResultPDFtoXps.xps"*/
const json = AsposePdfModule.AsposePdfToXps(pdf_file, "ResultPDFtoXps.xps");
console.log("AsposePdfToXps => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
Convert PDF to Grayscale PDF
Convert PDF to black and white with Aspose.PDF for Node.js via C++ toolkit. Why should I convert PDF to Grayscale? If the PDF file contains many color images and the file size is important instead of color, the conversion saves space. If you print a PDF file in black and white, converting it will allow you to visually check what the end result looks like.
In case you want to convert PDF document, you can use AsposePdfConvertToGrayscale function. Please check the following code snippet in order to convert in Node.js environment.
CommonJS:
- Call
require
and importasposepdfnodejs
module asAsposePdf
variable. - Specify the name of the PDF file that will be converted.
- Call
AsposePdf
as Promise and perform the operation for converting file. Receive the object if successful. - Call the function AsposePdfConvertToGrayscale.
- Convert PDF file. Thus, if ‘json.errorCode’ is 0, the result of the operation is saved in “ResultConvertToGrayscale.pdf”. If the json.errorCode parameter is not 0 and, accordingly, an error appears in your file, the error information will be contained in ‘json.errorText’.
const AsposePdf = require('asposepdfnodejs');
const pdf_file = 'Aspose.pdf';
AsposePdf().then(AsposePdfModule => {
/*Convert a PDF-file to grayscale and save the "ResultConvertToGrayscale.pdf"*/
const json = AsposePdfModule.AsposePdfConvertToGrayscale(pdf_file, "ResultConvertToGrayscale.pdf");
console.log("AsposePdfConvertToGrayscale => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
});
ECMAScript/ES6:
- Import the
asposepdfnodejs
module. - Specify the name of the PDF file that will be converted.
- Initialize the AsposePdf module. Receive the object if successful.
- Call the function AsposePdfConvertToGrayscale.
- Convert PDF file. Thus, if ‘json.errorCode’ is 0, the result of the operation is saved in “ResultConvertToGrayscale.pdf”. If the json.errorCode parameter is not 0 and, accordingly, an error appears in your file, the error information will be contained in ‘json.errorText’.
import AsposePdf from 'asposepdfnodejs';
const AsposePdfModule = await AsposePdf();
const pdf_file = 'Aspose.pdf';
/*Convert a PDF-file to grayscale and save the "ResultConvertToGrayscale.pdf"*/
const json = AsposePdfModule.AsposePdfConvertToGrayscale(pdf_file, "ResultConvertToGrayscale.pdf");
console.log("AsposePdfConvertToGrayscale => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);