Printing custom page sizes

Lindsay

New member
Joined
Feb 9, 2009
Messages
4
Programming Experience
5-10
I'm developing a program that uses PDFCreator to print to a PDF. Now I am trying to print custom page sizes, which are being set to the postscript custom page size under the printing preferences, advanced window from the print dialog box, but it seems to continually use the default values (8.5x11) no matter what I enter in as the page size. I do no think this is a limitation of PDFCreator since I am able to print from Word, Notepad, Opera, etc doing the exact same thing in setting page size and it does print out correctly. It's just from within code that it seems to want to use the default page size. From the advanced window I can select any of the pre-installed paper sizes and it does print for that size, but not custom size.

As a test I even downloaded acrobat to try out their PDF writer, and if I follow the same steps as mentioned, it still only prints the default size for custom from code. Acrobat does have a work around by creating a new paper size and adding it to the list of paper sizes available to the printers, but I'd rather not have to do that. That list already is pretty large (70) and adding more would make it, I feel, more unmanageable for the end user.

I can programmicaly force the page size if needed, which I might have to use to create my own print dialog to get the page size that the user want to print. I'm hoping though that I'm just missing something obvious. As can been seen, I'm not doing anything special with printing so maybe there is more stuff that I'm missing.


PrintDialog1.Document = PrintDocument1
If PrintDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
PrintDocument1.Print()
End If

Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
'calls subroutine that uses drawimage, drawtext, etc to draw to the graphic object, ie picturebox, printdocument, etc
DrawData(e.Graphics)
End Sub
 
Back
Top