简体   繁体   English

typescript 中 base64 pdf 的反色

[英]Reverse color of base64 pdf in typescript

If I have a random pdf encoded to base64, is there any way I can programmatically switch its colors to the negative form?如果我有一个随机 pdf 编码为 base64,有什么办法可以通过编程方式将其 colors 切换为否定形式? (Ex. white to black, red to blue, etc) (例如白色到黑色,红色到蓝色等)

I think yes: using PdfJS you can draw the PDF to a canvas, it's not to hard.我认为是的:使用 PdfJS,您可以将 PDF 绘制到 canvas,这并不难。 then with the canvas you can invert the colors, but you will have an image as a result and not a PDF.然后使用 canvas,您可以反转 colors,但您将获得图像而不是 PDF。 You can show that image in your HTML or download it.您可以在 HTML 中显示该图像或下载它。

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

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