0

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. I managed to print a usable but blurred image of the pdf. Trying to improve print quality, I searched for alternate ways to edit and print the pdf. So I thought that may be I could convert the pdf to xps and then convert the xps into a PrintDocument object. Converting the pdf to xps is easy, but I found nothing about converting xps to printdocument. If I could convert it then I could draw anything on it. Is there any way to do this conversion? Any sample code?

Community
  • 1
  • 1
pzogr
  • 424
  • 1
  • 12
  • 30
  • 1
    What is it you really want to do? Do you want to fill out fields in a form and print it? Some forms have the fields defined so you can fill them out programmatically : http://www.c-sharpcorner.com/UploadFile/scottlysle/PdfGenerator_CS06162007023347AM/PdfGenerator_CS.aspx Would this suit you? – mortb May 10 '13 at 08:36
  • @mortb: the link you provided seems very useful. I'll check it out. The original pdf does not have any forms but I could probably create some. That's exactly what I was looking for, from the start. I'm also interested in xps conversion though because I've done a lot of the dirty work to calculate the correct position of the text I've added - it's a lot of text and in different positions. – pzogr May 10 '13 at 09:11
  • Printers have a resolution that's easily 6 times better than a monitor. So if you don't make the image 6 times bigger, you'll end up with a fuzzy print-out where every pixel is a 6x6 blob on paper. Using xps doesn't change that. – Hans Passant May 10 '13 at 10:10
  • @Hans Passant: I don't understand... If you have a pdf form and create an image out of it, why can't the printer print it right? My image looks faint, like if there's not enough ink. The image is A4 size or a little bigger. – pzogr May 10 '13 at 11:08
  • An A4 piece of paper on a laser printer has 4960 x 7016 pixels. How many pixels does your bitmap have? – Hans Passant May 10 '13 at 11:21
  • @Hans Passant: it's 1012x1286. Does this mean, I can't print such an image? Should I enlarge it first in Photoshop and then print it? – pzogr May 10 '13 at 12:08
  • 1
    Well, clearly you can print it, you already did. You already enlarged it, Photoshop isn't magically going to create new pixels. Make the image larger when you create it. – Hans Passant May 10 '13 at 12:20

1 Answers1

0

I've worked with the pdf-component from http://www.dynamicpdf.com/ which was very useful, but not free. 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. Maybe you text objects and positions would be useful there? Sorry I can't tell you more about XPSs though..

mortb
  • 9,361
  • 3
  • 26
  • 44
  • Sounds really up to the job but too expensive. Thank you for taking the time to answer... – pzogr May 10 '13 at 11:12