visual studio 2010 - Printing WinForm with controls using PrintDocument component c# -


i'm not interested in having else job me, appreciate point in right direction.

i have couple of forms need printed. of them consisting of multiple datagridviews , other controls. jobcards, manufacturing sheets, stock cutting lists, quotes, etc etc..

i have tried many possible solutions on internet. printform component practically useless because of poor resolution. i've tried crystal report, success, use generate , print quotes , invoices.

'capturing' form (bitmap) ...(witch guess in case better alternative printform) doesnt cut ether.

msdn printing form (visual c#)

i'm rather demotivated, since last part of application before testing. want understand , learn can printdocument component can solve problem , gain vs-printing experience.

i'm in depth itext-sharp last resort. please tell me if prove fruitless(in case atleast;) appreciated.

thank kind sir or lady time , possibly knowledge

kindest regards

herman vercuiel new order form quote form generates in crystal reports enter image description here

the forms need print... amount of forms vary depending on type , amount of products ordered.

enter image description here

edit:

i'm settling @ moment..

how can make sure fitted 1 page? part of right side of form missing.

private void capturescreen()         {             graphics mygraphics = this.creategraphics();             size s = this.size;             memoryimage = new bitmap(s.width, s.height, mygraphics);             graphics memorygraphics = graphics.fromimage(memoryimage);             intptr dc1 = mygraphics.gethdc();             intptr dc2 = memorygraphics.gethdc();             bitblt(dc2, 0, 0, this.clientrectangle.width, this.clientrectangle.height, dc1, 0, 0, 13369376);             mygraphics.releasehdc(dc1);             memorygraphics.releasehdc(dc2);         } 

the controls on form optimized rendered on low-res raster device (the screen).
print optimized rendered on hi-res raster device (the printer).

so, if render form printer, may tiny print, or big print low res (like screen).

i'm not expert of printing... way can think of printing form on paper without having low-res big ugly pixel re-render form objects: enumerate controls on form, , draw controls way want, can decide how render them in hi-res. youcan decide looks of border of button, combo box, whatever...

implementing looks big job...

update
another, simpler, option may use bitmap raster converter.
can grab screen bitmap, pass bitmap in raster-to-vector converter, obtain vecotrialized version of bitmap, , can directly print vector-based image.

but automated raster-to-vector conversion may works... or may not work.
mileage may vary.

maybe can try "by-hand" grab screen , bitmap-to-vector conversion using free tools, inkscape (start inkskape, import bitmap, go in menu path\trace bitmap, , try out various options (color, bw, smoothing...)).
if have results, maybe you can find raster-to bitmap tool integrate in application.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -