Can I switch to Direct2D/DirectWrite and still use the same
rendering code for screen rendering and printing, and will
I get sensible and reasonably compact PDF files when printing
through a PDF-producing pseudo printer driver?
For now, my understanding is, screen display is done by using
Direct2D/DirectWrite on top of DirectX whereas printing can
be accomplished by using the same Direct2D/DirectWrite calls
on top of a GDI/GDI+ printing context. But the DirectStuff api
docs don't mention printing, so I'm really just guessing.
The docs do mention the use of software renderers to render
things on a GDI bitmap - but it's not clear whether or how
this will work with a printing context.
I understand these new APIs were designed for accelerated
screen display, with printing being a lesser concern. But I'd
find them less attractive if I'd have to maintain old-style
GDI rendering code for printing, in parallel with the new-style
DirectStuff rendering code for screen display.
-----------------Why I want this-------------------
I once wrote a note typesetting system, using GDI for the
rendering. I still use it for vocal scores but I'm not happy
with the rendering code. The text placement (which is a
major pain with vocal scores) is resolution dependent and
not proper wysiwyg, so what looks fine on screen can be
a mess when printed because the slightly different spacing
makes words overlap or collide with musical symbols.
I might be able to improve on it by using GDI calls that
calculate the glyph placements in high-res before
rendering them in device res, but I'd prefer to use the
new apis - if and only if I can still produce PDFs using
the same rendering code I use for the screen.
(Actually, matters are a bit more complicated, involving
a homebrew programming language, a cross-platform
framework, a choral website, the bones of an 824 year
old queen, and other stuff not really suitable for this NG,
but the end point is: can DirectStuff rendering be captured
as PDF, by GDI roundtripping or some other means???)
---------------------------------------------------
Regards/Ole Nielsby
-my mail reply addres should have all d's replaced with l's-
(I missed this because I used "printing" in all my searches.)
I'm having trouble drawing with Direct2D on a printer DC.
Drawing on screen works just fine. I can mix Direct2D and GDI on the same
HDC, but if the DC corresponds to a printer, the BindDC method of
ID2D1DCRenderTarget fails with E_INVALIDARG.
Does the ID2D1DCRenderTarget need to created in a different way for
printing, or what else could be wrong?
Thanks