简体   繁体   English

是否有用于修改 node.js 中的 pdf 文件的 npm 模块?

[英]Is there an npm module to modify a pdf file in node.js?

I'm building a node.js app on Bluemix that should take a pdf file as request and then grey out (blank) some part of the pdf file.我正在 Bluemix 上构建一个 node.js 应用程序,该应用程序应将 pdf 文件作为请求,然后将 pdf 文件的某些部分变灰(空白)。 And also here the pdf file is the same for all, and the area we need to blank out will be fixed.而且这里的pdf文件对所有人都是一样的,我们需要空白的区域将被修复。 So can anybody suggest an npm module that can perform this kind of functionality?那么有人可以推荐一个可以执行这种功能的 npm 模块吗?

I suggest you to try HummusPDF .我建议你试试HummusPDF Specifically take a look at the Hummus - Modification page, that explains how to edit existing PDF documents.具体看一下Hummus - 修改页面,它解释了如何编辑现有的 PDF 文档。 In your case you could try to use the feature that allows to draw shapes .在您的情况下,您可以尝试使用允许绘制形状的功能。

Yes I guess the most common used library is pdf-lib .是的,我猜最常用的库是pdf-lib Take a look at the official page .看看官方页面

Try using this: http://pdfmake.org . 试试这个: http//pdfmake.org It is the improved version of https://github.com/devongovett/pdfkit 它是https://github.com/devongovett/pdfkit的改进版本

You can set the color of the font as "white" to fade out which ever text you want. 您可以将字体的颜色设置为“白色”,以淡出您想要的文本。 Following is a sample code, which you can try here: http://pdfmake.org/playground.html 以下是示例代码,您可以在此处尝试: http//pdfmake.org/playground.html

subheader: {
            fontSize: 15,
            bold: true,
            color: "white"
        },

Please try Aspose.PDF Cloud SDK for Node.js available at GitHub and npm .请尝试GitHubnpm上提供的适用于 Node.js 的 Aspose.PDF Cloud SDK。 It provides API methods for a wide range of document processing operations;它为广泛的文档处理操作提供了 API 方法; including creation, manipulation, conversion and rendering of Pdf documents in the cloud.包括在云中创建、操作、转换和呈现 Pdf 文档。 You can use Redaction Annotation to grey out the required PDF area.您可以使用密文注释将所需的 PDF 区域变灰。

PS: I work with Aspose as Support Developer PS:我与 Aspose 作为支持开发人员一起工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM