Click here to Skip to main content
15,895,538 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: split a CString Pin
Rage2-Nov-04 20:18
professionalRage2-Nov-04 20:18 
GeneralRe: split a CString Pin
RYU^^2-Nov-04 20:19
RYU^^2-Nov-04 20:19 
QuestionHow to implement DirListBox and DriveListBox in Visual C++ ? Pin
vhmau2-Nov-04 19:43
vhmau2-Nov-04 19:43 
AnswerRe: How to implement DirListBox and DriveListBox in Visual C++ ? Pin
vcplusplus3-Nov-04 0:27
vcplusplus3-Nov-04 0:27 
AnswerRe: How to implement DirListBox and DriveListBox in Visual C++ ? Pin
David Crow3-Nov-04 3:35
David Crow3-Nov-04 3:35 
GeneralUrgent help, please... "error C2668: 'log' : ambiguous call to overloaded function" Pin
2-Nov-04 19:14
suss2-Nov-04 19:14 
GeneralRe: Urgent help, please... "error C2668: 'log' : ambiguous call to overloaded function" Pin
Christian Graus2-Nov-04 19:37
protectorChristian Graus2-Nov-04 19:37 
GeneralEmbedding Font to PDF Pin
RYU^^2-Nov-04 18:56
RYU^^2-Nov-04 18:56 
Hi there,

I am creating a program that allows me to create the PDF file without using the Distiller. I am stuck in embedding the font. I have tried to use CDC::GetFontData() to read the font data. But still doesn't work.

From PDF documentation, I must include the following tables:
- head - hhea
- loca - maxp
- cvt_ - prep
- glyf - hmtx
- fpgm - cmap

Currently, I used GetFontData() to get the font data and write the BYTE into the file.

Below is the function that I wrote to get the font data:
BYTE * GetFontDataByte(const CDC *pDC, DWORD dwTableName, DWORD & dwSize)
{
dwSize = pDC->GetFontData(dwTableName, 0, 0, 0); //get the buffer size
if(dwSize == -1) return NULL;

BYTE *lpData = new BYTE[dwSize];
if(pDC->GetFontData(dwTableName, 0, lpData, dwSize) == -1) //get the actual font data
{
dwSize = -1;
delete [] lpData;
return NULL;
}

return lpData;
}

Please note: the *pDC contains the selected font. (e.g. pDC->SelectObject(selectedFont);)

Once I got that byte (byte data), I write that byte into PDF Stream. The problem is that everytime I open the PDF file that I created (with embedded font), it always display "Unable to extract the embedded font ..." error message.

Can anyone please help me? I am pretty new with all of this stuff.

Thank you very much in advance.

Ryu Thomas
GeneralPlease help me... Pin
RYU^^3-Nov-04 11:54
RYU^^3-Nov-04 11:54 
GeneralRe: Embedding Font to PDF Pin
RYU^^18-Nov-04 18:16
RYU^^18-Nov-04 18:16 
GeneralRegarding grid Pin
balajeedurai2-Nov-04 18:24
balajeedurai2-Nov-04 18:24 
GeneralRe: Regarding grid Pin
Christian Graus2-Nov-04 19:38
protectorChristian Graus2-Nov-04 19:38 
GeneralRe: Regarding grid Pin
balajeedurai2-Nov-04 21:15
balajeedurai2-Nov-04 21:15 
GeneralConvert a string to DWORD Pin
Iceberg762-Nov-04 18:02
Iceberg762-Nov-04 18:02 
GeneralRe: Convert a string to DWORD Pin
shiraztk2-Nov-04 18:28
shiraztk2-Nov-04 18:28 
GeneralRe: Convert a string to DWORD Pin
Rage2-Nov-04 20:25
professionalRage2-Nov-04 20:25 
GeneralRe: Convert a string to DWORD Pin
Alexander M.,3-Nov-04 6:20
Alexander M.,3-Nov-04 6:20 
GeneralRe: Convert a string to DWORD Pin
Iceberg763-Nov-04 7:52
Iceberg763-Nov-04 7:52 
GeneralRe: Convert a string to DWORD Pin
Iceberg763-Nov-04 18:12
Iceberg763-Nov-04 18:12 
GeneralRe: Convert a string to DWORD Pin
ThatsAlok3-Nov-04 17:30
ThatsAlok3-Nov-04 17:30 
GeneralRe: Convert a string to DWORD Pin
Iceberg763-Nov-04 17:46
Iceberg763-Nov-04 17:46 
GeneralRe: Convert a string to DWORD Pin
ThatsAlok3-Nov-04 18:14
ThatsAlok3-Nov-04 18:14 
GeneralI have a Problem ..Please help me. Pin
pubududilena2-Nov-04 17:51
pubududilena2-Nov-04 17:51 
GeneralRe: I have a Problem ..Please help me. Pin
Christian Graus2-Nov-04 19:39
protectorChristian Graus2-Nov-04 19:39 
GeneralSDI Applicaion Pin
zahid_ash2-Nov-04 17:51
zahid_ash2-Nov-04 17:51 

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.