UWP Printing: FontFamily, problems in printing - printing

Believe it or not, I have a UWP app that needs to print multi-part forms on a dot matrix printer. We got a print driver, and we can print just fine from Word/Notepad. However, from my application the fonts look really bad. The test docs used 'Courier New' at 12 pitch. This is exactly what I have in my style for the printed information. However, when it comes from my app, the font looks nasty. I have tried numerous font family combinations and nothing seems to help.
Any ideas/pointers would be appreciated. Thanks.

Turns out the problem was the printer driver. Switching to the Windows Update driver specific for that printer solved all the problems. Wish the inbox driver had worked, but happy it is resolved.

Related

How to use a host-based USB printer from WinCE

I'm testing an HP LaserJet printer with WinCE7, it's a host-based (not PCL) printer.
When it's plugged into the USB port of WinCE, the USBPRN.dll is loaded but PCL.dll is not loaded which is as expected.
I included wordpad in WinCE and tried to print from wordpad, but there is a error message box saying no printer babah. Printer setting dialog box is not displayed.
Then I use CreateFile/WriteFile/CloseHandle APIs and try to send some ASCII string to the LPT1 port.
The return handles are valid but nothing happened on the printer. According to the debug log, I see something wrong inside WriteFile although the return value is valid.
Then I'm stuck.
I have several other options to try:
Use OpenPrinter/StartDocPrinter/WritePrinter API set. But I'm not
sure if they are different from CreateFile/WriteFile/CloseHandle.
Check to see if there's any open sourced driver for the printer in
Linux world, then I can see what's the data & format I should send
to the printer. But I don't know Linux at all. I'm not sure what
part is different from Windows to Linux or what part is same to
different OS.
Anyone can point out any information about how to implement a
host-based printer driver? Just introduction about the architecture
is also welcome. For example, is there anything related to the
device context (DC) or bitmap or anything else.
I'd like to see any comment on which direction I should go.
Thanks,
Fei

What are the issues with regards to printing non-standard fonts in RDLC reports?

We use the Microsoft Report Viewer control in our web application to print checks. The report needs to use a special MICR bank font in the report. Something like this: http://www.micrfonts.com/
Anyways the font is just a regular TTF font installed in Windows.
Now, when testing the printing on my local setup, everything works perfectly. The checks print on my personal LaserJet using the font correctly.
However, at my client's site, he is telling me that the font is rendering in the web-browser OK, which I think confirms that he has the proper font installed on his machine, but when he sends the report to the printer, the printout does not use the correct font.
Are there any limitations with the RDLC printing with regards to non-standard fonts? I'm not sure how to troubleshoot this issue.
Any help would be appreciated.
More details that I just discovered:
Apparently, everything works from my PC if I connect to my local instance of the app on localhost.
However, if I connect to my app on our remote dev environment, I can replicate the issue of the font not properly printing.
Figured it out. Apparently the font needs to be installed both on the client, and on the webserver.
When rendering to screen, the report viewer uses Html, so the font needs to be on the client machine. However, when printing, the report is generated server side before being sent to the printer, so in that case, the font needs to exist on the server, otherwise it will be substituted.
Took a while to find this. Hope this helps someone else.

Crystal report changing printer programatically not working

We have an application written in Delphi and we are using Crystal report 11 for reports.
There is a HP 3 tray printer which we uses for printing. Our order form is printing to tray3 in pre-printed document, and after that the order details are supposed to print on tray2 plain paper. But its not happening, if we are doing these tasks simultaneously, instead of tray2 the second print-out going to tray1.But both print-out are going to correct try,if we are exiting and login again each time. I have changed the printer in code , by giving different printer(each tray is added as separate printers) for each print-out. But its not working.
I have given the printer name to Tcrepe (crystal report component in delphi) for changing the printer, is there anything else do?.
Please advice.
Thanks in advance.
Open the report in Crystal and point it to that 2nd printer/tray. Once saved in the report, you shouldn't have a problem.

Printing excanvas

I can't get IE to print my canvas (generated using excanvas)... I'm using the most recent version of excanvas.
http://dl.dropbox.com/u/997831/canvas.html
(Note: I already tried having the canvas element already on the page instead of creating it with document.createElement)
Unfortunately, there is no good answer here. There has been a ticket open for well over a year regarding the printing of excanvas that has yet to be answered. You could try the silverlight version of excanvas it's a little better but still suffers from similar problems.
The only way to get it printed properly now would be doing a print screen and then printing the image. Unless an newer version of excanvas comes out or IE9 is released, native printing on IE just isn't going to work.
my best shot currently is printing pre-rendered image
(see wkhtmltoimage on google code)

Delphi Printer.Printers not refreshing

I have created a Delphi service which is responsible for printing QuckReports to specific printers contained within the printer.Printers list. I pass my routine the printer name and it looks up in the printer.printers array to get the proper index. It then does this:
QuickRep1.PrinterSettings.PrinterIndex := iIndex;
In the help files it says this for printer.refresh: "Call Refresh when the installed fonts or printers on the current system may have changed". So I call the refresh before I look up the printer name against the printer.printers array.
At one of my installations this function is not working properly. If printers are added/deleted, or someone with printers under their profiles logs on, the list does not seem to get refreshed until the service is stopped and restarted.
Does this function not work for services?
The installation where this is occurring utilizes "virtual services". Could this have anything to do with it?
Thanks.
My experience and understanding is the printers array is updated only at application start. Anytime a new printer is installed, the application must be restarted to get the correct list.
I'm curious to hear any different experience with this myself.
EDIT: From my comment below; I wrote a small test program that confirms the TPrinters.Refresh() does update the printers list.

Resources