• Welcome to PlanetSquires Forums.
 

CPrintPreview (version 1.0.1)

Started by Paul Squires, March 22, 2023, 09:51:09 AM

Previous topic - Next topic

Paul Squires

Re-upload because Github was changing CRLF line endings to LF causing the demo resource file not to compile properly with GoRC. I simply changed the .gitattributes and re-uploaded the resource file. The demo should compile correctly now.

https://github.com/PaulSquires/CPrintPreview/releases
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Petrus Vorster

Hi Paul

Wonderful stuff.
The barcodes works as a font.

I changed the section of business name into a barcode and it works.
You cannot view this attachment.

Now i just need a THOROUGH read of the documentation, but this will do jsut fine for my purposes!

Great Stuff

Peter
-Regards
Peter

philbar

Hi Paul,

Internet was down at work yesterday, so I had time time to play with CPrintPreview, and yes!

1. Minor bug: when I set the Zoom level to a percentage, the horizontal scroll in the preview didn't work. It flickers a bit, but doesn't move. Windows 11, in case that matters.

2. Minor bug, I think: If I try to print twice with the same preview dialog, it hangs. The printer dialog doesn't appear until after the preview is canceled.

3. NBD: I added CPrintPreview to a Designer program, and I got 2 complaints about UNICODE being multiply defined. So I changed
#define UNICODE
for
#ifndef UNICODE
   #define UNICODE
#endif

4. In the WriteTextBox function, I took out the DT_SINGLELINE flag so I could choose things like this:

You cannot view this attachment.

and it worked like a charm!

Paul Squires

Awesome, thanks guys for the reports. I will make some tweaks today to the code. :)
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Dennis Hoskins

Hi Paul,

When I run the demo, some fields seem to be oversized. I am running Win 10 Pro versionYou cannot view this attachment.  22H2

philbar

Grumble.

When I got home, I ran the demo on my (Win 10 Pro) laptop, and it didn't have the "no print twice" problem.

Then I copied it to my Win 11 computer, which uses a TV for a monitor, and it does have the "no print twice" problem. So it seems to be a Windows 11 thing.

When the demo runs on the TV (1366 x 768, big screen), it shows the same scrunching that Dennis reported. Maybe it's a Low DPI effect?

Dennis Hoskins

I do have my display set to 200%.
Dennis

Paul Squires

My display is at 250% (4K laptop panel). Not sure (yet) why you guys are getting the skewed fonts.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Dennis Hoskins

My display is a 32" 4K. I should note that the printed demo invoice is identical to the displayed version. I print without any scaling (100%).

Petrus Vorster

Hi All

I am still very new to cprintpreview and going to attempt something I am not sure if it can be done.

If I create a barcode with ZINT, it places a PNG on the drive.
Can we use cprintpreview to print that barcode?
I dont have the vaguest idea how one would do that.

Also, (Paul knows what i am busy with), I wonder if its practically fast enough to create a loop that create a barcode in zint, upload and print it and repeat to bulk print labels, each with unique barcodes?
(Isn't this going to be resource heavy or memory problematic?)
I am going to print stacks of 1000+ at a time.

Guidance would be most welcome.

-Peter
-Regards
Peter

Paul Squires

The cprintpreview class does not handle images yet.

I can't answer your second question because that is something that would have to be actually benchmarked on your hardware and computer. In theory, I wouldn't say that it would be overly resource intensive.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

I imagine that I could write some simple FreeBasic code to print a PNG image to a printer. I would just use GDI+ to load it and then print it using regular win32 API calls.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Petrus Vorster

Hi Paul

Lets wait and see what happens.
I am getting the strange feeling I have been played again.
For now, my little app works, and if or when I actually see an industrial printer makes its appearance, I could spend more time and effort on this project.

Your help so far made many things possible.
I am very grateful.

Kind regards,

Peter
-Regards
Peter