Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 28th, 2003, 12:00 AM
Vantera Vantera is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: South Coast of NSW, Australia
Posts: 108 Vantera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via ICQ to Vantera
Article Discussion: Printing Using C#

Printing Using C# If you have any questions or comments about this article please post them here.

You can read the article here .
__________________
Kind Regards,
John Rebbeck
john@interspire.com
ICQ# 74637937

Reply With Quote
  #2  
Old March 19th, 2003, 04:12 AM
rschrode rschrode is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 2 rschrode User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problems with PrintEngine

Hi there,

I found the PrintEngine article very useful and informative - just one problem:

in the OnBeginPrint method (PrintEngine class), there is a call to 'element.Print();' towards the end. However, element is not an extension of IPrintable. Changing this to 'printObject.Print(element);' seems to sort out the problem.

This leads to another problem - the print preview is fine, but the actual output (ie. hardcopy) is garbage. It's not the font - changing that simply changes what the garbage looks like! Printing to both a printer and a PDF file produces the same result, so that rules out printer driver issues. Seems to be that the text is corrupted somewhere along the line (possibly by the change I've made above).

Anyone else had similar problems?


Thanks,
Richard

Reply With Quote
  #3  
Old March 29th, 2003, 04:42 PM
BoRong BoRong is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 3 BoRong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy

I have the same problem and find no solution. Maybe the author has one????
Thanks.

NTN

Reply With Quote
  #4  
Old March 30th, 2003, 02:58 PM
BoRong BoRong is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 3 BoRong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile

Hi,

I have find out that there is not thing wrong with the code, but it is the Printer settings that causes the problem. What I did to the code to work is going to my Print Processor of the printer properties and change the Default datatype it to TEXT. That 's it :-).

Best regards,

NTN

Reply With Quote
  #5  
Old March 31st, 2003, 02:39 AM
rschrode rschrode is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 2 rschrode User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi there,

Where did you find the Printer Settings? I've been looking around in the PrinterSettings object but can't find anything about the default datatype.

Thanks for the help!
Rich

Reply With Quote
  #6  
Old March 31st, 2003, 10:07 AM
BoRong BoRong is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 3 BoRong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

The Datatype is in the Advanced tab or button depending on the printer you have. And then click on the Print Processor button. You should see it on the left of the appearing dialog.

Best regards,

NTN

Reply With Quote
  #7  
Old June 6th, 2003, 05:45 PM
PKahn PKahn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 1 PKahn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problem with Printengine

I had the same problem with it printing garbage, but it did print out right when I switched the printer settings to text.

My question is, how do I set it up so that the user won't even have to bother with doing that?

Reply With Quote
  #8  
Old February 20th, 2004, 06:28 PM
tcpip77 tcpip77 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 tcpip77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking HELP please

NTN could you please email your code for the print engine. I tried working throught the code and there are parts where I am not sure if I am to add the code or change it and it is all cinfusing. Could you please send me the complete working code of the program so that I can see if all my Classes and member and functions are correct. The article gets a little confusing in parts.

Thankyou for your time

Travis


Quote:
Originally Posted by BoRong
Hi,

I have find out that there is not thing wrong with the code, but it is the Printer settings that causes the problem. What I did to the code to work is going to my Print Processor of the printer properties and change the Default datatype it to TEXT. That 's it :-).

Best regards,

NTN

Reply With Quote
  #9  
Old March 8th, 2004, 01:59 PM
krugs525 krugs525 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 krugs525 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Printing garbage!

When I go to print some text to my printer in a C# app, I am getting a whole bunch of garbage characters. Everything looks fine in the print preview. I am guessing it has to do the fact that .NET uses Unicode, and my printer might not be. Any ideas on what I can do to fix this?

Reply With Quote
  #10  
Old April 7th, 2004, 03:51 PM
ntsiro ntsiro is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 ntsiro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 42 sec
Reputation Power: 0
Wink

Hello everyone !

I really liked this article ! it kind of put my mind to rest after reading tones of useless info elsewhere that i couldnt decifer !

A few question though if anyone could help me please though !

Any links for further info on PageSettings so as to set them programmaticly without using the PageSetupDialog?

how about if I wanted to assign a printer which is a print share on a network , is that possible ? I mean, say i wanted to print to a printer called \\lala\printer0 without it beeing installed on the computer running the application?

Also, is this all possible using the Compact Framework as well ?

Thanx a million,

Cheers,
a student at need !!

Reply With Quote
  #11  
Old April 13th, 2004, 05:12 PM
orlan orlan is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 orlan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
After fixing
element.Print(); with

public
void Print()

{

_printObject.Print(
this);

}


The example is working fine on all the printers except the ones that use generic text driver.
When I am trying to print to generic text I am getting Win32Exception:
"The data area passed to a system call is too small"

Please, can someone help me?

Reply With Quote
  #12  
Old September 26th, 2004, 07:53 PM
ironsnake ironsnake is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 1 ironsnake User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
add image to print document

what can i do to add a image to the print document?

tks in advance

Reply With Quote
  #13  
Old October 7th, 2004, 08:00 AM
romanm romanm is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 romanm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to romanm
Printing to generic text only printer (i.e. to file) problem

Hi Orlan,

I'am interesting if you found solution to your problem printing to generic printer i.e. to file. If you did I would appreciate if you can share this solution.
Thank you very much in advance

Roman

Quote:
Originally Posted by orlan
After fixing
element.Print(); with

public
void Print()

{

_printObject.Print(
this);

}


The example is working fine on all the printers except the ones that use generic text driver.
When I am trying to print to generic text I am getting Win32Exception:
"The data area passed to a system call is too small"

Please, can someone help me?

Reply With Quote
  #14  
Old October 12th, 2004, 01:40 AM
jaydubal jaydubal is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 jaydubal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Arrow " Cannot span more than one line "

Hello all,

This is a very good article and I could implement it as a code. But I am facing some problems. The article says : "Font object to measure the height of the primitive, although we're going to assume that a single primitive cannot span more than one line:".

In my case long text go out of page / overlap with other contents. How can this be fixed ? Also when there is a need to print two primitives horizontally (one Text and other Rectangle) then what is the yPos returned ? same about Image printing.

Anticipating a reply

Thanks in advance
Jay (jay_dubal@yahoo.com)

Quote:
Originally Posted by Vantera
Printing Using C# If you have any questions or comments about this article please post them here.

You can read the article here .

Reply With Quote
  #15  
Old October 14th, 2004, 04:23 PM
anupamatchicago anupamatchicago is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 anupamatchicago User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation

Quote:
Originally Posted by Vantera
Printing Using C# . You can read the article here .
Since so much is wriiten here abt printing engine , I would like to know if there is any way of specifying the "NUmber of Pages per sheet" to print programmatically. This is a requirement as the documents/ pdfs in question are if big size and they cannot be saved but printed directly from n ASP.net page.
Thanks in advance

Reply With Quote
  #16  
Old November 13th, 2004, 05:25 PM
Si-clone Si-clone is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 1 Si-clone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Have you worked out a solution to your multi-line text? If not, let me know as I have crashed something crude out that workds (at least for me).

I'm about to work on the image printing.



Quote:
Originally Posted by jaydubal
Hello all,

This is a very good article and I could implement it as a code. But I am facing some problems. The article says : "Font object to measure the height of the primitive, although we're going to assume that a single primitive cannot span more than one line:".

In my case long text go out of page / overlap with other contents. How can this be fixed ? Also when there is a need to print two primitives horizontally (one Text and other Rectangle) then what is the yPos returned ? same about Image printing.

Anticipating a reply

Thanks in advance
Jay (jay_dubal@yahoo.com)

Reply With Quote
  #17  
Old March 11th, 2005, 01:44 PM
Marathoner Marathoner is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 1 Marathoner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 30 sec
Reputation Power: 0
Question

I finally got all the code in the classes where it belongs but I still have one issue. When I click the slidder to add additional records, the additional records overwrite the one above it starting on the third line. Does anyone know how to position the records under each other so they view and print without writing on top of each other?

Thanks,

Robert

Reply With Quote
  #18  
Old July 16th, 2005, 11:00 AM
sesmith2k sesmith2k is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 1 sesmith2k User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 12 sec
Reputation Power: 0
Where can I download the code for this article?

Quote:
Originally Posted by Vantera
Printing Using C# If you have any questions or comments about this article please post them here.

You can read the article here .


Where can I download the code for this article?

Reply With Quote
  #19  
Old August 22nd, 2005, 03:49 PM
shentho shentho is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 1 shentho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 20 sec
Reputation Power: 0
Smile Sample Code

Here is the code from the article in a working project.
I hope this gets you started.

Please submit any enhancements to the code, to this thread, so that we may all benefit.

Good luck
Attached Files
File Type: zip Printing.zip (19.7 KB, 1438 views)

Reply With Quote
  #20  
Old September 8th, 2005, 04:34 PM
godseyeview godseyeview is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 1 godseyeview User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 2 sec
Reputation Power: 0
Quote:
Originally Posted by orlan
After fixing
element.Print(); with

public
void Print()

{

_printObject.Print(
this);

}


The example is working fine on all the printers except the ones that use generic text driver.
When I am trying to print to generic text I am getting Win32Exception:
"The data area passed to a system call is too small"

Please, can someone help me?


I have the same issue. Can someone post the solution to this problem?
thanx
quang

Reply With Quote
  #21  
Old November 20th, 2006, 01:24 PM
rmmarsh rmmarsh is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 1 rmmarsh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 41 sec
Reputation Power: 0
Arrow Changing fonts

Has anyone had any luck in changing the fonts? I have tried to change fonts for both previewing and printing, but have no luck... I want to use a fixed-width font... any ideas?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Article Discussion: Printing Using C#


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap