简体   繁体   English

从C#WinForms中的.xps文件创建PrintDocument

[英]Create PrintDocument from .xps file in c# winforms

On this thread I tried to figure out how to get an image created from a pdf file, fill the blanks and print it out. 线程上,我试图弄清楚如何从pdf文件中创建图像,填充空白并打印出来。 I managed to print a usable but blurred image of the pdf. 我设法打印了可用但模糊的pdf图像。 Trying to improve print quality, I searched for alternate ways to edit and print the pdf. 为了提高打印质量,我寻找了其他方法来编辑和打印pdf。 So I thought that may be I could convert the pdf to xps and then convert the xps into a PrintDocument object. 所以我想可能是我可以将pdf转换为xps,然后将xps转换为PrintDocument对象。 Converting the pdf to xps is easy, but I found nothing about converting xps to printdocument. 将pdf转换为xps很容易,但是我对将xps转换为printdocument却一无所获。 If I could convert it then I could draw anything on it. 如果我可以转换它,那么我可以在上面画任何东西。 Is there any way to do this conversion? 有什么办法可以进行这种转换吗? Any sample code? 任何示例代码?

I've worked with the pdf-component from http://www.dynamicpdf.com/ which was very useful, but not free. 我使用了http://www.dynamicpdf.com/的pdf组件,该组件非常有用,但不是免费的。 They have a pdf-merger component which allows you to import a pdf and draw new things (text labels, images etc) on top of it. 它们具有pdf合并组件,可让您导入pdf并在其顶部绘制新内容(文本标签,图像等)。 Maybe you text objects and positions would be useful there? 也许在此处输入文本对象和位置会有用吗? Sorry I can't tell you more about XPSs though.. 抱歉,我无法告诉您更多关于XPS的信息。

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

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