Last active
October 6, 2024 16:46
-
-
Save blog-aspose-cloud/0b9b424974f335d0694d176a894764a7 to your computer and use it in GitHub Desktop.
Revisions
-
blog-aspose-cloud revised this gist
Dec 19, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # Convert PDF to Word in Node.js <br> <a href="https://wiki.fileformat.com/view/pdf/">PDF<a> file is multiplatform and can be viewed on any platform and you can edit files to some extent. However, we cannot easily edit the PDF file but on the other end, if we have a word document, its easy to edit and manipulate the content inside it. This gist explains the steps on how to develop PDF to Word converter online using <a href="https://products.aspose.cloud/pdf/nodejs/">Aspose.PDF Cloud SDK for Node.js</a>. For complete information, please visit <a href="https://blog.aspose.cloud/pdf/pdf-to-doc-converter-aspose.pdf-cloud-sdks-for-node.js/">PDF To Word in Node.js.</a>  -
blog-aspose-cloud revised this gist
Dec 15, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # Convert PDF to Word in Node.js <br> <a href="https://wiki.fileformat.com/view/pdf/">PDF<a> file is multiplatform and can be viewed on any platform and you can edit files to some extent. However, we cannot easily edit the PDF file but on the other end, if we have a word document, its easy to edit and manipulate the content inside it. This gist explains the steps on how to develop PDF to Word converter online using <a href="https://products.aspose.cloud/pdf/nodejs/">Aspose.PDF Cloud SDK for Node.js</a>. For complete information, please visit <a href="https://blog.aspose.cloud/pdf/pdf-to-doc-converter-aspose.pdf-cloud-sdks-for-node.js/">PDF To Word in Node.js.</a>.  -
blog-aspose-cloud created this gist
Dec 15, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ Convert PDF to Word using Node.js SDK This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ import { Controller, Post } from '@nestjs/common'; import { AppService } from './app.service'; import { PdfApi } from 'asposepdfcloud'; import \* as fs from 'fs'; @Controller() export class AppController { constructor(private readonly appService: AppService) {} @Post('/pdf-to-doc') async pdfToDoc() { const name = 'm.pdf'; const SrcFile = '/' + name; const resultName = 'result.doc'; const resultPath = 'myfolder/' + resultName; const storageName = 'testing'; const fileToWrite = process.cwd() + '/' + resultName; const pdfApi = new PdfApi( 'YOUR-APPSID', 'YOUR-APPKEY', ); try { const data = fs.readFileSync(name); await pdfApi.uploadFile(SrcFile, new Buffer(data), storageName); await pdfApi.putPdfInStorageToDoc( name, resultPath, // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore '', '', '', '', '', '', '', '', '', storageName, ); // Download pdf from cloud storage const fileData = await pdfApi.downloadFile(resultPath, storageName, ''); const writeStream = fs.createWriteStream(fileToWrite); writeStream.write(fileData.body); return 'PDF converted to DOC successfully'; } catch (e) { throw e; } } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ # Convert PDF to Word in Node.js <br> <a href="https://wiki.fileformat.com/view/pdf/">PDF<a> file is multiplatform and can be viewed on any platform and you can edit files to some extent. However, we cannot easily edit the PDF file but on the other end, if we have a word document, its easy to edit and manipulate the content inside it. This gist explains the steps on how to develop PDF to Word converter online using <a href="https://products.aspose.cloud/pdf/nodejs/">Aspose.PDF Cloud SDK for Node.js</a>. For complete information, please visit <a href="https://blog.aspose.cloud/pdf/pdf-to-doc-converter-aspose.pdf-cloud-sdks-for-node.js/">PDF To Word in Node.js. PDF to DOCX or PDF to DOC conversion</a>.  ## Important Links [Product Page](https://products.aspose.cloud/pdf/nodejs/) | [Docs](https://docs.aspose.cloud/pdf/developer-guide/) | [Live Demo](https://products.aspose.app/pdf/family) | [Swagger UI](https://apireference.aspose.cloud/pdf/) | [Code Samples](https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-node.js/tree/master/Examples) | [Source Code](https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-node.js) | [New Releases](https://repository.aspose.cloud/pdf/) | [Blog](https://blog.aspose.cloud/category/pdf/) | [Free Support](https://forum.aspose.cloud/c/pdf/13) | [Free Trial](https://purchase.aspose.cloud/trial)