Support Forums > General Board

EZP a Print Control

(1/3) > >>

James Klutho:
Edit July 22, 2017 - Updated the include file (now version 2)to be high dpi aware for the print preview dialog but I have no way to test it. Also, I explicitly defined parameters as BYVAL or BYREF.  Parameters that were FB arrays remained as is since they balked at this effort.

Edit July 23, 2017 - Updated the include file to version 3 and made modifications to the PowerPoint demo.  Removed the EZP_SetProcessDPIAware from the include file and put in the PowerPoint demo.  Tried scaling the control fonts in the dialog callback

I have been working on a print control in the spirit of DDoc for the last couple of months.  It is a wide-string utility which compiles in 32 or 64 bit in Freebasic for Windows and is in the form of an include file - much like GRD.  You might have a look at it to see if it is useful to you.  I have actually included some documentation with this one.  There are quite a few samples so hopefully you can figure out what I was trying to do with this project.  I think there are enough objects defined to be generally useful in set up pages for printing and previewing.

A couple of stumbling blocks I never solved. 1) Enumerating printers on a remote network.  For the life of me, I could not enumerated the network printers at work that I have access to except for the default printer.  These remote printers (except for the default) are not in the registry.  Some voodoo here I am not privy to. 2) Rotating bitmaps around there center and controlling where they end up.  The GDI+ matrices baffle me and I could not find any useful examples on the internet.  There were a lot of inquiries on the subject and the solutions offered were not generalized enough.  I'm sure Patrice know how this is done but my little brain is fried on the subject.

Anyhow, good luck to everyone.
Jim

Josť Roca:
Looks very good. A couple of observations:

1) You should add  BYVAL or BYREF to all the parameters (there are many parameters without it). Otherwise, it will give errors if compiled with the option -w pedantic and will be broken if __FB_OPTION_BYVAL__ is set to -1.

2) It is not DPI aware. This makes a big difference in sharpness in the preview window and also the controls become minuscule if the application that uses it is DPI aware. See attached captures.

Regarding printers enumeration in a remote network, it can be done using WMI. I wrote a WMI class wrapper (CWmiCli), but I limited it to work with the local computer because I don't have access to a network and, therefore, I can't do tests.

James Klutho:
Thanks Jose for your input.  I will rest for a week or so then tighten down some of the bolts you suggest.  Jim

aloberr:
you is a large programmer because you proved reliable with POWERBASIC, I use your GRID and your PRINTPREVIEW, I also wrote a control GRID not badly, I do not find it for the moment in my archives. in addition Your printPreview is good, in the past I tried to do it, instead of storing the data in a document, a decided to draw directly on the pages by having a table of pages(control STATIC), I butted the fitting of these pages because certain drawings did not post a whole but very likewise, I could make ravel the pages of continuation, like in WORD.   

James Klutho:
I updated the included file in the first post of this thread.

Navigation

[0] Message Index

[#] Next page

Go to full version