PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET PrintDocument and Custom PaperSize

Reply

PrintDocument and Custom PaperSize

 
Thread Tools Rate Thread
Old 04-04-2006, 07:22 AM   #1
=?Utf-8?B?TWFkZXJu?=
Guest
 
Posts: n/a
Default PrintDocument and Custom PaperSize


Good Morning,
I'm developing a code that needs to deal with
different printer user formats which have to be
created on a network driver printer (OKI 321).

The big issue I am finding is that the printer doesn't
allow me to handle with more than 1 defined format at
the same time. We could say it allows me to define
just ONE format at a time (and it is going to work
with the last format I set), even though the settings
are being defined either manually -at the printer
server- or with the given code seen below.

In addition, when I use that code, it will not work
when the printer is not physically connected to the
computer.


'Code used to get the type of paper

For Each PaperSize In
PrintDoc.PrinterSettings.PaperSizes
If
PaperSize.PaperName.IndexOf(oDSInfo.Tables(0).Rows(0)("NombrePapel"))
>= 0 Then

Encontrado = True
Exit For
End If
Next

'If PaperSize was not found, I call this function
'which creates the adequate paper size at the printer


MJMCustomPrintForm.MJMCustomPrintForm.AddCustomPaperSize(PrinterName,
"_jf" & oDSInfo.Tables(0).Rows(0)("PaperName") &
vbNullString, rPagina.Width, rPagina.Height)

PrintDoc.DefaultPageSettings.PaperSize = PaperSize

PrintDoc.PrinterSettings.DefaultPageSettings.PaperSize
= PaperSize

However, even though I set the correct Papersize if
there is more than one personalized format set, it
only will take the last format defined.

Can anybody help me, please?

Thank you very much in advance ...!




  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off