|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
I have the same problem and find no solution. Maybe the author has one????
Thanks. NTN |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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? |
|
#8
|
|||
|
|||
|
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:
|
|
#9
|
|||
|
|||
|
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?
|
|
#10
|
|||
|
|||
|
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 !! |
|
#11
|
|||
|
|||
|
After fixing
element.Print(); with publicvoid 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? |
|
#12
|
|||
|
|||
|
add image to print document
what can i do to add a image to the print document?
tks in advance |
|
#13
|
|||
|
|||
|
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:
|
|
#14
|
|||
|
|||
|
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:
|
|
#15
|
|||
|
|||
|
Quote:
Thanks in advance |
|
#16
|
|||
|
|||
|
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:
|
|
#17
|
|||
|
|||
|
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 |