0
votes

My company is moving to a new system which has a very poor printing system in place but it does create PDF's on the file system.

My Boss has asked me to create an application to print all the PDF's based on a JOB number.

I've gotten the filesystem search working, I have used the acrobat sdk to open each file and find certain strings to determine which pages go where.

The problem I'm dealing with is that the Acrobat SDK doesn't seem to support choosing printer settings.

My first thought was no big deal I just change the default windows printer and just change the tray so the invoice part and equipment listing go to white paper from tray 1, and the remittance goes to tray 2 on blue paper.

It seems like the printdocument in .net can handle alot of printer settings but I'm not sure if a PDF can be used with a print document.

Looking for any advice or assistance.

Thanks,

Joshua

2
Careful with the change default printer trick. Some one printing something else at the same time, or worse still an other application using the same technique. Not to mention being polite and setting the default printer back to what it was. Avoid if possible.Tony Hopkinson
Yeah I have a class library that sets default printer and then on application close restores the original default printer. Luckily we are going to be setting the application up on a non user desktop setup specifically for this task. It will be roughly 3000 invoices (PDF), and probably around 15k+ pages of paper.JoshF
I might have found the answer after looking for the last hour or two. I still need to test it out but found this site: edinkapic.blogspot.com/2011/01/… I'll update if this meets my requirements.JoshF
Ok well that site worked for me, but I don't understand any of the win32 code. I am ok with not understand, but is there a way to do this with .net managed code? I haven't been able to find an easy solution yet.JoshF

2 Answers

0
votes

I found the answer was to use Win32.

Here was the website that helped me get through some of the hurdles:

http://edinkapic.blogspot.com/2011/01/how-to-set-printer-default-paper-bin-in.html

0
votes

The underlying problem is that PDFs are combination of vector graphics for the text and bitmapped images. It all needs to be rendered into a format the printer understands before being printable.

Ghostscript does this very nicely and if you need to do it from .Net, GhostScript.Net provides an excellent vb.Net interface.

The problem I'm dealing with is that the Acrobat SDK doesn't seem to support choosing printer settings.

You can't use the desktop version of Acrobat for this, since it's not designed for unattended operation and requires a user interface. Also, I believe it violates Adobe's license.