I am trying to allow the user to select an appropriate paper size for their printer within my own print settings dialog. Does anyone know a workable solution - preferably cross platform but otherwise OSX.
If I use a TPageSetupDialog then when executed it produces an error in the PASever window of Invalidpmobject although the dialog shows but doesn't seem to affect the current printers paper size. There doesn't seem to be any proerties to see what the user selected either.
I need to set the paper size without actually printing as the user needs to be able to adjust things with the new paper size first.
I finally figured out the problem so here is the solution for anyone else with the problem:
Use TPageSetupDialog but you must set valid pagewidth and pageheight values for the current printer before calling it - otherwise you get an error reported in PAServer window and the printer selection box will be set to "any printer" instead of the current printer name.
Unfortunately you cannot derive the paper size directly from the printer pagewidth and resolution because it reports printable area not paper size. So I set a default of A4 whenever the user chooses another printer. I guess you could set the nearest standard paper size to the calculated value from printer.pagewidth/printer.activeprinter.activedpi.x if you want to take care of printers that do not support A4.
The other point to note is that the default page sizes in the TPageSetupDialog component are wrong. Set the units to mm and use width 210000 and height 297000 (note 10 times bigger than the default values) for A4 size that most printers should support.
Related
fist off, if there is an exchange place more suitable for the question, please address me.
I'm designing some labels in gimp.
I created a A4 300dpi document and created the artwork, arranged them to use all the page. To measure the labels I create a rectangle with the "rectangle selection tool" and there one can inspect the size in cm:
I printed straight from gimp and to my surprise, the printed labels where smaller than designed. I assumed somehow someone along the line added margins to my already A4 document..
I tried saving to PDF and then printing the PDF, very similar results.
I'd say the difference is around 5%
What would be the appropriated method for printing exactly at the size I created the document ignoring any margins ??
I'm using Windows 10, HP ENVY 5010 and Gimp 2.10
I'm printing some pdf's using Ghostscript.NET
this is my config.
List<string> switches = new List<string>
{
"-empty",
"-dPrinted",
"-dFirstPage=1",
"-dLastPage=1",
"-dPrinted",
"-dBATCH",
"-dNOPAUSE",
"-dNOSAFER",
"-dNumCopies=1",
"-sDEVICE=mswinpr2",
#"-sFONTPATH=" + System.Environment.GetFolderPath(System.Environment.SpecialFolder.Fonts),
"-sOutputFile=%printer%" + printQueue.FullName,
"-f",
inputFile
};
It works pretty well but my paper size is a custom paper 6.5in x 8.5in, my problem is when I print silent to my ricoh printer, try to print in letter.
How can i do to set my paper size in my switches or force the printer to render it properly.
If i print manually must select the paper and bin manually and all print's perfect.
The mswinpr2 device uses Windows to do the printing, in particular the media size is set by the printer canvas.
So the answer is to set the default media selection of your printer to the required media size before you start printing.
You can set the paper size with "-sPAPERSIZE=a4" you can see Paper sizes known to Ghostscript.
or you can set it by height and width
"-dDEVICEWIDTHPOINTS=w"
"-dDEVICEHEIGHTPOINTS=h"
Where w be the desired paper width and h be the desired paper height in points (units of 1/72 of an inch).
I have a problem on impression of tickets in continuous paper thermal printer. I have done a report with paper size "custom", height 50 cm and I have checked "Endless page height" option, but when I print the ticket, it ends when he has a height of a Din A4 page.
Any idea why? I need to configure any more?
I use FastReport 5 in Seattle 10
I have searched info about this but nothing found.
try to mark check Large height in design mode, not Endless page height in report options, and set paper size = custom, with correct width and height (in your case 50 cm).
I have exactly the same problem without founded yet a solution until today that I'm working with C++Builder 11.1.
As a work-around, I divided the entire long report into some few different groups, each of them printed onto a new page. The grouping could be by category or some other valid concept for the user, if any.
The resulting report is going to be few pages cut at a small length than the original, but it will allow to show the whole expected information. It is not what I wanted originally but is a valid alternative solution for me.
Do you finally found a solution to reach your objective to print the report on a longer than Din A4 page?
(Powerbuilder 11.5.1 build 5097)
I have found that the text size setting (Windows7 Control Panel -> Appearance and Personalization -> Display "Change Text Size") alters printed reports coming from powerbuilder.
When set to smaller - 100% (default), the report works as designed
When set to Medium - %125, 33 rows of data take up nearly one full extra printed line and get cut off.
When set to Large - %150, the report works as designed again.
All my testing is being done with the same computer using the same printer changing just this one widnows preference. The report contains a fixed-size box which takes up most of the right half of the page. When I print using "medium fonts" the bottom of the data gets cut off. Folding over the page and comparing it to a "smaller font" print shows that the report block is exactly the same size but the data within it is drifting downwards.
Call me old fashioned but I firmly believe that the display settings of my monitor should not affect prints. Anyone have any information on how to make powerbuilder behave correctly?
I am in progress of converting a really old 25+ year old application .
It sends an escape sequence to make the SCREEN 132 characters wide...
However it didnt work and i put the XTERM equilivment that seems to work in most cases..
It is
"\x1B[8;50;132t"
Although the screen resizes with success there is an issue
Here is the code that the COBOL program uses to execute the command
pg -f FILETOSHOW
using CALL "SYSTEM" USING BY CONTENT DS-REC
where DS-REC is the above command....
The problem is that although screen resizes data are printed with the previous settings... Calling again the program solves the issue and prints correctly...
Doesnt anybody knows whether i should send another escape code also?
The escape sequence is documented in XTerm Control Sequences, in the "Functions using CSI , ordered by the final character(s)" section, under this line:
CSI Ps ; Ps ; Ps t
It is one of the controls adapted from dtterm, and in particular
Ps = 8 ; height ; width
Resize the text area to given
height and width in characters. Omitted parameters reuse the
current height or width. Zero parameters use the display's
height or width.
It was implemented in xterm in 1996 (patch #18).
Because some users view operations of this sort as a security problem (including resizing the font), a resource windowOps was added in 2003 (patch #174) to allow packagers to change the default behavior. That resource can be modified at runtime using a menu entry, as well as set directly in a user's X resources.
In short, the feature is present in xterm, but may require (simple) configuration changes to use it.
The control sequence to resize the xterm window is a request to the window manager. The window manager may not honor the request, e.g., for tiling window managers it would always fail. Also, because xterm does not change the font-size dynamically, it may fail if the font size is too large to permit 132 columns on the screen. The fixed font probably works for modern large displays (my 1280x1024 monitor can display 60x210 with some slack), but large fonts may not.
When it fails to resize as large as requested, it is the window manager which handles the request: xterm has forgotten by the time the request is completed, and will accept whatever the window manager does.
Do not rely on these escape codes. xterm will not set itself to a size greater than the screen. So given the user has a large-enough font and/or a small-enough screen, he will not get his 132x50 terminal automatically, much less will the automatic sizing do it.
(E.g. lucida console at 15pt on 1024x600 minus a taskbar and WM deco gives me room for 85x28 cells.)
If your program requires such an awkward vt size of 132x50, request it of the user as a prerequisite. Or just make your program actually run on any variable size.