PDFDoc Scout |
PDFDoc Scout library
How to create PDF document file
from Visual C++ using PDFDoc Scout library:
"Hello,
World!" example
You can download the source code of this example here: pdfdocscout_vc.zip This tutorial will teach you how to create simple PDF document from VC++ using PDFDoc Scout library. 1) Install PDFDoc Scout library on your computer and run Visual C++ 2)
Select the "New.."
command from "File"
menu (as it is shown below) to run :
![]() 3)The
New
Project Wizard
dialog will appear on the screen. Select "Win32
Console Application"
project type and enter "HelloWorld" as the Project name
as shown on the screenshot below:
![]() ![]() 4)
The wizard will ask what kind of Console Application you
want to create. Select A
"Hello, World!" application and
click Finish:
![]() VC++ will
show the summary information for a new project. Click
OK:
![]() Visual C++
will generate the application code for simple console
application
Source code editor
window will appear. To edit main()
function just open the class tree on the left and double
click on "H
elloWorld Classes"
| "Globals"
| "main
(int argc, char* argv[1])":
![]() VC++ will open
main()
function:
![]() 5)
To use PDFDoc
Scout from
VC++ application you have to tell the compiler to import
type library information into the project.
To import the
type library just add
#import
compiler directive after #include
directive:
#import "PDFSDoccout.tlb"
using namespace PDFDocScout; 6) The
code snippet that will generate PDF document should be
placed in main() function body.
// HelloWorld.cpp : Defines the entry point for
the console application. #include "stdafx.h" #import "PDFDocScout.tlb" int main(int argc, char* argv[]) // check for errors // get inuque ID for IPDFDocument interface // initialize library // set output PDF filename // starts PDF documen generation // add text to current page at (100,100) with
15 degrees rotation // release PDFDoc object // uninitialize OLE libraries This code will generate PDF document file that will be saved as "c:\HelloWorld.PDF" file Hint: you
can simply copy and paste the code from the sample above
into VC++ code editor window:
7)
Run the application by pressing F5
(or use
"Build" | "Debug" | "Go")
VC++ will compile
and run "Hello, World!" application. It will generate
Shapes.PDF
file
on C:\
disk
You can view
generated PDF file (.PDF) using Adobe Reader or
another application that is capable of displaying pdf
documents.
You can download the source code of this
example here: pdfdocscout_vc.zip
"Hello, World!" quick start step-by-step tutorials: |
|
|
||