473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.AddCustomPap erSize(PrinterName,
"_jf" & oDSInfo.Tables(0).Rows(0)("PaperName") &
vbNullString, rPagina.Width, rPagina.Height)

PrintDoc.DefaultPageSettings.PaperSize = PaperSize

PrintDoc.PrinterSettings.DefaultPageSettings.Paper Size
= 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 ...!


Apr 4 '06 #1
0 1866

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Break40 | last post by:
I have created a custom papersize 5" x 12". If I send a report using portrait my iformation shows up just fine. If I set landscape to true, and try to print I get nothing or just 1 line per page. ...
2
by: Robert Hooker | last post by:
Hi, I'm curious to know if I'm doing something wrong here, or if this is just mind-numbingly slow for a reason. In a simple WindowsFormsApplication: public Form1() { // Required for...
0
by: PMGuy | last post by:
Hi guys: We're struggling with a peculiar user request. We're re-implementing an application and a piece of the app allows the users to print a letter and cooresponding envelope to a...
0
by: Jacek | last post by:
Hello I use PrintDocument in asp.net application to print in network. It works when application is on win2k professional but there are problems with XP and Win2003 server. Is this because of...
0
by: Krich | last post by:
I use printer Epson TM-U220A (receipt printer). When I try to get its default papersize. It returns as Custom paper and its width and height = 0. How can I get the paper's width and height of this...
0
by: toufik | last post by:
I'm using a printDocument object to print a text. How can I set the paper size fomat to LETTER format here is the code that I started, I don't know if its the good direction....
0
by: Dino Buljubasic | last post by:
Hi, my application is accessing PrinterSettings to set page size programmatically. I have been using it already for a while and never had a problem like this before. ' get paper size dim...
2
by: Steve | last post by:
I'm trying real hard to set the printer resolution for a PrintDocument. It appears that the printer is already set to 300 x 300 dpi, which is JUST what I want. But the Margins and PrintableArea...
0
by: smckibben01 | last post by:
I am trying to change the papersize with the following commands and it tells me the Kind must be set to custom as shown in the title but it is a read only property. How do I have custom page sizes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.