google cloud print tray media size - printing

I read the GCP documentation, I managed to grab in the google drive folder the documents I need to print every day before the guys enter the office, these docs are pdf in A5 format, I have the second tray filled with A5 paper.
By the GCP interface i can print all of them selecting A5 format (not the tray) and they are printed accordingly, using the script amended with the width and length size (148000 and 210000 in microns) I obtain the doc printed in A5 format on the A4 paper, I tried to change the tray paper but the printer got error ( Kyocera ).
I searched all the web looking for some info regarding how to set the tray, on the same GCP docs and also here in a question, I understand that I could grab printer capabilities by using /printer service, I think that in there I could read how to amend the ticket and selecting the tray if it would be possible. I do not understand how to use /printer service, any suggestion on how to get it?

Although you can retrieve the printer's input trays by checking the InputTrayUnit attribute in the PrinterDescriptionSection of the Cloud Device Description, it is not possible to set this information in a job ticket: There's no way to set the tray in the PrintTicketSection of the Cloud Job Ticket

Related

Google Sheets - add items to a list

Each of my employees has their own spreadsheet containing job information. Each person's sheet imports data from a larger dataset where their entries are tagged by the tech's name. When an error in the information is detected, they write the new value in a particular column adjacent to the erroneous information. I have a sheet, which I keep open on my desktop, that pulls the corrections into a central location. I make the corrections in the central job information sheet, navigate to the employee's sheet and erase their correction to let them know the correction has been made to the central job info sheet. When I erase their correction, it drops off my notification sheet. I need a way to store that correction either in their individual sheet or in my central corrections notification sheet. I need to track each correction beyond the time it was made and subsequently erased.
When Bob reads "Serial# 123456" and issues a correction it is actually "Serial #234567", I need to retain the information that Bob issued that correction to the main job info data.
Does anybody have a suggestion?

How do I get the PrinterIndex using the Printer Name using Delphi?

I need to assign a printer for each of three different printing functions, labels, receipts and "standard" (e.g. A4). I have identified all of the printers available using listbox1.assign(printer.printers) but there doesn't appear to be a way to use this to establish the printer's PrinterIndex. I want to store the printername and index value in a file so that I can use printer.printerindex to assign a printer to each type of print job without asking the user to choose a printer using a dialog.
Am I going about this the wrong way, and if so, could someone please tell me the right way to do it, please? I've not had to use the printers unit directly before.
Save the printer name in the file, not the index.
When you restart the program and read back the printer name. Then loop thru all printers to find which one has the saved name (It could have been removed or renamed) and use that printer.

Google Cloud Print with TSP100 variable length document

I currently have the following issue. I would like to print a receipt (pdf file) on a Star TSP100 thermal printer with Google Cloud Print (from AppEngine). The connection works great, but I have an issue with the positioning.
The PDF file has a variable length, and therefore I have to print the document on 72mm x 2000mm (so the length is always correct). The remaining whitespace is cut off by the printer. When I print a receipt with the default print dialog in Chrome, the document is positioned at the top of the canvas (72mm x 2000mm). However, when I try to print the same document with Google Cloud Print the document is positioned at the center of the canvas. The result is a lot of whitespace before the actual receipt starts. The whitespace after is still cut off correctly by the printer.
Things I tried so far:
Setting a specific media size in the Cloud Job Ticket (CJT). Then the printer cuts off at 200mm length (default printer setting).
Posting a printjob from Chrome and checking the CJT of this job in the GCP Simulation API. The CJT is not different from mine, so how is Chrome able to print a different document?
All other options in the CJT as described in the Google Cloud Print Documentation.
Banging my head against the wall, also didn't work.
If I could mimic a request from Chrome (which gives the correct result), the problem would be solved. However, I can not see how these are different from my requests.
Any help is greatly appreciated!

Report design issues with receipt paper

I have a report in Crystal Reports that runs and works great. However, there is an issue that I am facing. Right now, it runs, prints the patient copy, blank section, and then office copy of a purchase receipt. The problem is this all printers on one sheet of paper to an Epson thermal printer before it cuts. Then we have to tear between the two copies to give the customer theirs and keep ours. What I would like to find out is if there is a way to simulate 2 reports in one. So the out come would be this: prints customer copy, cuts the paper, prints the office copy.
I have attached a screen shot of how it is current set up and wanted to see if anyone had some suggestions on how I could possibly get the result I want without telling it to run 2 reports.
Thanks for any and all help.
Current Report Design
As of me it may not possible. You have to give separate print command to thermal printer. E.g. Pass the parameter as Patient Copy and Print it. again call & print the same report with pass the parameter as Office Copy. Hope by doing this it will solve your problem.

Save Printer Setup Parameters

I am writing a program using Delphi 2006 and storing data in XML files and a Firebird database. I create reports using either FastReports, Excel or QuickPDF. I allow my users to package several reports together and be directed to a destination of their choice, whether it is a PDF file, a printer, the screen, or email.
I want my users to be able to configure their printer choices for the reports they send to printers. To do this, I will use the printer dialog to choose a printer and set the properties of that printer. I want to be able to capture those properties and store them so that when they run their package of reports, they will all go to the correct printer using the configurations they have chosen.
I know different printers have different configuration possibilities. For example, one that I use will allow me to choose to print booklet style so you can produce a 5 1/2 X 8 1/2 booklet from a report. It's possible that a user might choose an option like that when they are configuring a report in their package and expect that report to print in that manner. There are probably lots of possibilities that I am not aware of but would like to allow if that is possible. I just don't know how to capture that configuration from the printer dialog, store it in a database and then use that information to configure the printer when it's time to print the report.
How can I translate the information stored in the printer dialog into something I can store (even in a blob) in a database and then use that information to configure the printer?
Thank you for your help.
AFAIK, that isn't possible. The printer setup dialog is standard, but quite often is replaced (or modified) to include additional printer specific setup information (eg., the booklet information you mentioned). Since there's no way for anyone other than the printer driver publisher to know what's there, there's no way to reliably get the information in a generic fashion.
The GetPrinterDataEx() API function Jeroen mentioned won't work, either, as it requires you to know ahead of time the name of the registry key that was used to store information via the SetPrinterDataEx() procedure, and that may or may not have been used by the printer driver. If it was used, you'd have to manually look at the registry to see where the driver publisher decided to store the info; I'd suspect that varies between printer manufacturers as well.
FOLLOWUP: I just ran a quick check and I'm pretty sure the above is correct. If I use the Printer Setup dialog from a Delphi app to access printer settings (for example, the duplex setting before running a report), no changes are written to the registry. However, if I go into the Control Panel Printer applet and change settings there, the registry is updated. This seems to confirm that per-report setting selections made on the fly by the user would be hard to save, as they're probably not accessible anywhere except to the printer driver. Permanent type settings (those made in the control panel applet) are made by the user and the user opts to make them permanent on a system-wide basis, and therefore they're saved to the registry. This seems to preclude saving those types of options on a per-report basis, at least from the printer setup dialog changes.
This is all possible, but for a specific printer on a specific computer. Basically, you ask the printer driver for its custom config data, and store that exactly as is. You can then pass it back later to print with.
Check out the following Windows API functions. If you want C code for this, ask in a comment. Actually, I'll copy a chunk here of the code I use, sorry it isn't translated to Delphi! This is from real working code though, hard fought over. Hopefully it will give you some clues.
bGood = OpenPrinter(pcDeviceName, &hPrinter, NULL);
int sBuffSize = DocumentProperties(hDlg, hPrinter, pcDeviceName, NULL, NULL, 0);
PDEVMODE pxDevMode = (PDEVMODE)malloc(sBuffSize);
gl_memset(pxDevMode, '\0', sBuffSize);
pxDevMode->dmSize = sBuffSize;
DocumentProperties(hDlg, hPrinter, pcDeviceName, pxDevMode, pxDevMode, DM_PROMPT | DM_COPY);
DocumentProperties(hDlg, hPrinter, pcDeviceName, pxDevMode, NULL, DM_COPY);
DocumentProperties(hDlg, hPrinter, pcDeviceName, pxDevMode, pxDevMode, DM_PROMPT | DM_COPY);
DocumentProperties(hDlg, hPrinter, pcDeviceName, pxDevMode, pxDevMode, DM_UPDATE | DM_MODIFY);
ClosePrinter(hPrinter);
I know this should be possible with GetPrinterDataEx, but I could not find information about people having this used.
--jeroen
The documentation for the Windows API PRINTDLGEX Structure might contain some hints. In particular I think the hDevMode handle gives you the bits that are specific to a printer driver, even though they're undocumented. I don't know how you would use this information from Delphi.
It appears that a similar question was answered with information that may solve my problem for me. Thanks for your responses.

Resources