Re: Problem printing text with wxWidgets 3.2.2.1

Fulvio Senore <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>

Il 13/09/2023 22:41, Vadim Zeitlin ha scritto:
> FS> Create a class to encapsulate a print job. Add methods to start the job,
> FS> write text and some graphics primitives, to start a new page and to end
> FS> the job starting the real printing process.
> FS>
> FS> All method calls are stored in memory until the job is ended, then real
> FS> printing begins. A printout is created and all the commands are
> FS> retrieved from memory ed executed in the printout.
> FS>
> FS> This ought to shield the user from the complexity of printing,
> FS> presenting a very simple interface.
> FS>
> FS> Do you think that this is a reasonable approach?
> 
>   AFAICS this means reimplementing Windows metafiles in wxWidgets or, at
> least, something very similar to it, and this is not easy to do at all and
> all but impossible to do efficiently at our level.
> 

I never used metafiles so don't understand your sentence. Isn't it 
possible to store the metafile in memory and print it later, together 
with the other commands?

Anyway, I was thinking of this class of a simple way to print simple 
documents, mainly text-based. Just think of a report. In this case it 
ought to be enough to support text, some simple graphic primitives and 
images in a few standard formats.

If the purpose is to support everything then the task would be different.

>   I think we need to keep the idea of having some function called with wxDC
> parameter and rendering onto it. But it could be a callback instead of a
> virtual function, e.g. a std::function<void (int page, wxDC&)> or something
> like this.
> 

This is surely a good idea. We could also add a function to get the wxDC.

Fulvio

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/ea249f34-9973-c1f0-88b8-7206623e613c%40fsoft.it.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.