Click here to Skip to main content
15,886,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: GDI+ Bitmap::GetHBITMAP error: Pin
followait1-Dec-07 20:17
followait1-Dec-07 20:17 
GeneralRe: GDI+ Bitmap::GetHBITMAP error: Pin
Mark Salsbery1-Dec-07 20:23
Mark Salsbery1-Dec-07 20:23 
GeneralRe: GDI+ Bitmap::GetHBITMAP error: Pin
followait1-Dec-07 20:30
followait1-Dec-07 20:30 
GeneralRe: GDI+ Bitmap::GetHBITMAP error: Pin
Mark Salsbery1-Dec-07 20:33
Mark Salsbery1-Dec-07 20:33 
QuestionWhat pointer do I pass to my display function Pin
sclaxplayer1-Dec-07 19:37
sclaxplayer1-Dec-07 19:37 
GeneralRe: What pointer do I pass to my display function Pin
Nelek4-Dec-07 21:13
protectorNelek4-Dec-07 21:13 
Questioninput both text as well as image Pin
keyto1-Dec-07 18:23
keyto1-Dec-07 18:23 
AnswerRe: input both text as well as image Pin
bob169721-Dec-07 19:40
bob169721-Dec-07 19:40 
keyto wrote:
Please Explain me in detail


If you really want to write your own PDF Writer, the PDF Reference is the item you'll need...

PDF Reference, Sixth Edition, Version 1.7[^]

Just a fair warning, the text was written from one professor to another and is not easy to digest, navigate, or absorb. It lacks practical samples and the file format is binary which makes exposition even more confusing since at first glance it looks like its a text format.

I think I spent a few months on it before I had anything useful but once you get going and start to figure out the approach, it gets much easier.

I strongly recommend using GDI+ for bitmap and text conversion. You need to extract the bitmap bits yourself and encode them (PDF supports just about every useful encoding scheme). You will need an implementation of LZW or you can use zlib to compress your streams, otherwise the PDF file size gets quite large.

You need to synthesize things like font glyph underlining and strikethrough since those features are not part of the font glyphs. This requires you dig into the font files or use GDI font metric functions to get the cell ascent, cell descent, underline thickness, strikethrough position, etc...

If you want your screen previews to match your PDF output, you can use GDI+ antialiased fonts which are very close once you translate font heights and line placement. PDF does not support multiline in a way that matches line spacing with GDI or GDI+ so you must calculate each lines coordinates and place each line of text.

I'd say if you skip some of the more advanced PDF features, you should have a good working model of a PDF writer in about 6 months.

If this timeframe is too long, you might try printing your graphics primitives from GDI or GDI+ to a PDF print driver like "PrimoPDF" or "Acrobat".
QuestionWhere to initialize the dialog in CDialogBar? Pin
followait1-Dec-07 15:50
followait1-Dec-07 15:50 
AnswerRe: Where to initialize the dialog in CDialogBar? Pin
Mark Salsbery1-Dec-07 16:27
Mark Salsbery1-Dec-07 16:27 
AnswerRe: Where to initialize the dialog in CDialogBar? Pin
bob169721-Dec-07 17:36
bob169721-Dec-07 17:36 
AnswerRe: Where to initialize the dialog in CDialogBar? Pin
Mark Salsbery1-Dec-07 18:25
Mark Salsbery1-Dec-07 18:25 
GeneralRe: Where to initialize the dialog in CDialogBar? Pin
followait1-Dec-07 19:42
followait1-Dec-07 19:42 
Questionparameters vs members Pin
bob169721-Dec-07 14:06
bob169721-Dec-07 14:06 
AnswerRe: parameters vs members Pin
Mark Salsbery1-Dec-07 15:56
Mark Salsbery1-Dec-07 15:56 
GeneralRe: parameters vs members Pin
bob169721-Dec-07 17:14
bob169721-Dec-07 17:14 
QuestionHeader Wrapper Symbol Pin
steph51-Dec-07 11:21
steph51-Dec-07 11:21 
AnswerRe: Header Wrapper Symbol Pin
Bram van Kampen1-Dec-07 11:56
Bram van Kampen1-Dec-07 11:56 
AnswerRe: Header Wrapper Symbol Pin
bob169721-Dec-07 14:22
bob169721-Dec-07 14:22 
Questionreg: error C2440: 'specialization' : cannot convert from '' to ' (__cdecl *)(const char *)' [modified] Pin
naresh_t1-Dec-07 3:45
naresh_t1-Dec-07 3:45 
GeneralRe: reg: error C2440: 'specialization' : cannot convert from '' to ' (__cdecl *)(const char *)' Pin
David Crow14-Mar-08 5:59
David Crow14-Mar-08 5:59 
Questionclasses and inline functions Pin
Lutosław1-Dec-07 2:39
Lutosław1-Dec-07 2:39 
GeneralRe: classes and inline functions Pin
David Crow14-Mar-08 6:03
David Crow14-Mar-08 6:03 
QuestionBitmap button Pin
Schehaider_Aymen1-Dec-07 2:34
Schehaider_Aymen1-Dec-07 2:34 
AnswerRe: Bitmap button Pin
Hamid_RT1-Dec-07 3:14
Hamid_RT1-Dec-07 3:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.