Custom paper size problem

S

Sukh

Hi,
I am tring to change the paper size from default to custom paper size.
In print preview its showing my custom size but when I print it print
on default paper size.
Can any one help me to figure out this?
I am using following code:
Dim customPaperSize As New PaperSize("11x9", 1100, 900)

pdMain.DefaultPageSettings.PaperSize = customPaperSize

'pdmain is Friend WithEvents pdMain As
System.Drawing.Printing.PrintDocument

Thanks in advance
Sukh
 
T

tommaso.gastaldi

Ciao Such,

Try passing, before printing, the Default setting to the Printer
setting.

Me.PrintDocument1.DefaultPageSettings

= copy into === >
Me.PrintDocument1.PrinterSettings.DefaultPageSettings


Let me know if this solves your problem,

Tommaso
 
S

Sukh

Tommaso Thanks for replying...that I fixed that prob but now stuck with
differnt issue


I am printing a report on pre-printed continue paper using dot-matrix
printer using vb.net and paper size is custom

on first page it print data on correct locations. But

After printing first page it increase paper 3cm vertically/Height so on

second
page actual data goes down by 3 cm, So each time it increase 3 cm mean
on second page its 6cm and on 3rd page 9cm so on.... So After printing
the
first page on correct locations , data goes on different locations
which is complete mess.

please give any suggestion or any idea.

I am creating my own custom size page and setting the same for
printing.


Thanks
Sukh
 
T

tommaso.gastaldi

I am glad it worked.
For the second issue I can only guess, because don't know your code:

- Wrong size of physical page, and have you checked the margins? Note
that the printable area is in general always smaller than the physical
page (of course) Looks like you have an excess of 1.5 top and down,
which could be the margin...

- When doing page/margin computation check that you reset possible
variables used to count or sum...

Sukh ha scritto:
 
S

Sukh

Thanks for repling...
margins from the Top is always same...:(
and wht's the meaning of "Sukh ha scritto: "

Thanks Again..coz very few people answer my queries...
Sukh
 
T

tommaso.gastaldi

Hi Sukh (sorry for previous misspelling),

Nothing important, it's just "Sukh wrote": it's put there automatically
by "Google Gruppi" when quoting.

Well, about your problem, I am afraid I cannot be of much help without
seing the code or an exemplification of it. However, it seems a problem
easy to fix. Probably it's just that you have made your page a little
too tall, or something alike...

must be a little careful with the printer setting. The first time one
use it, usually does not realize the different purpose of the default
settings and the printer settings...

a presto,

Sukh ha scritto:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top