如何将PNG添加到PDF? [英] How to add a PNG to a PDF?

查看:1032
本文介绍了如何将PNG添加到PDF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我的MFC应用程序生成PDF,现在我正在尝试添加对透明的PNG文件的支持。



我开始只使用条目/ Mask来掩盖一种颜色。



我尝试过:



Hi,

My MFC application generates PDF's and now I'm trying to add support to PNG files with transparency.

I'm starting with just using the entry /Mask to mask one color.

What I have tried:

I extracted the IDAT chunk of the PNG and added to the object stream and used the "transparent color" (which I obtained with FreeImage) in the /Mask entry.

My PDF image object:

6 0 obj
<<
/Type /XObject
/Subtype /Image
/Name /Im1
/Width 60
/Height 23
/BitsPerComponent 8
/Length 484
/ColorSpace /DeviceRGB
/Filter /FlateDecode
/Mask [0 0 0 0 0 0]
>>
stream
    % IDAT CHUNK %
endstream
endobj


I also tried adding the tRNS chunk to the stream of a XObject and using SMask but that didn't work.





我开始使用颜色键掩码因为我认为它是最容易的。我知道这是一个非常广泛的问题,但任何提示或方向都将非常受欢迎。



这个是我的PDF,我正在使用这个图片要测试。



谢谢!



I'm starting with the "color key mask" because I believe it's the easiest one. I know this is a very broad question but any hint or direction will be very appreciated.

This is my PDF and I'm using this image to test.

Thanks!

推荐答案

如何在C#中使用C#for Visual Studio 2005将图像转换为PDF [<] a href =https://code.msdn.microsoft.com/How-to-convert-Image-to-1ef3cae5target =_ blanktitle =New Window> ^ ]


这篇关于如何将PNG添加到PDF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆