AlwaysLearningNewStuff
AlwaysLearningNewStuff

Reputation: 3031

Missing file from MSDN example for GDI printing

I am trying to learn to print using GDI.

I have searched MSDN for resources and found this example.

I like the thought of putting printing in separate thread, and using GDI is easier for me to learn than using XPS API so I have downloaded the example.

After trying to compile it ( I use Visual Studio 2008 ) I get this error:

fatal error C1083: Cannot open include file: 't2embapi.h': No such file or directory

According to this, I have found out that I am not the only one facing this problem.

Still, I have tried to Google the above error and found this that indicates me not having the latest SDK.

I have searched in C:\Program Files\Microsoft SDKs\Windows and found a folder v6.0A which indicates that I do not have latest SDK installed.

However, here I have found one post where person with the same problem did not solve it by downloading the latest SDK ( although the year that post was made is 2006, still the file was missing then too, and downloading the SDK didn't help-why should anything change now? ).

My question is:

  1. Is there a way to get this file ( if I am wrong about downloading the latest SDK please correct me ) ?

  2. I think that this file has to do something with fonts-is there a way to modify the example so I do not have to use that file?

Thank you for you rime to view this thread and for trying to help.

Best regards.

Upvotes: 1

Views: 513

Answers (2)

hyun
hyun

Reputation: 2143

Your question is:

1. Is there a way to get this file ( if I am wrong about downloading the latest SDK please correct me ) ?

  • The latest version of Windows SDK is for Windows 8.1. Windows Software Development Kit (SDK) for Windows 8.1. However, I think the 't2embapi.h' have already included Windows SDK for Windows 7, because I found the header file in 'C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include'.

2. I think that this file has to do something with fonts-is there a way to modify the example so I do not have to use that file?

  • @Hans Passant has already answered about that.

Upvotes: 2

Hans Passant
Hans Passant

Reputation: 942099

T2Embapi.h is supplied by the Windows SDK, it contains declarations for the Font Embedding Services Library to handle embedded OpenType fonts. Clearly the SDK version you use is too old to have it. Not exactly sure which version is required, I know that v6.0 doesn't have it but v7.1 does.

There's some sloppiness in the project due to it starting as an XPS sample. T2Embapi isn't actually required to build the GDI sample. You can simply delete the #include from stdafx.h. Also some sloppiness in the Release configuration settings of the project, remove T2embed.lib and XpsPrint.lib from the linker's Additional Dependencies setting.

Upvotes: 2

Related Questions