| |
1. long __stdcall CreatePDF(char *filenam) |
| |
2. void __stdcall ClosePDF(long id) |
| |
3. long __stdcall SetPDFSecurity(long id,long level ,long limit,char *userpassword,char *ownerpassword) |
| |
4. long __stdcall SetPDFInfo(long id,char *title,char *subject,char *author,char *keyword,char *creator) |
| |
5. long __stdcall AddPS(long id,char *filename) |
| |
6. long __stdcall Convert(long id) |
| |
Example |
| |
4. long __stdcall SetPDFInfo(long id,char *title,char *subject,char *author,char *keyword,char *creator) |
| |
Description: |
| |
Set PDF file information. |
| |
Parameters: |
| |
id : A handle of PS Converter.. |
| |
title : Set title to PDF file , it may equal NULL. |
| |
subject : Set subject to PDF file, it may equal NULL. |
| |
author : Set author to PDF file, it may equal NULL. |
| |
keywords : Set Keywords to PDF file, it may equal NULL. |
| |
creator : Set Creator to PDF file, it may equal NULL. |
| |
Return Value: |
| |
Nonzero if it is successful; otherwise, it is zero. |
| |
5. long __stdcall AddPS(long id,char *filename) |
| |
Description: |
| |
Insert PS/EPS file into PDF file |
| |
Parameters: |
| |
id : A handle of PS Converter.. |
| |
filename : File name of ps/eps. |
| |
Return Value: |
| |
return value of 0 indicates an error, otherwise is succeed. |
| |
|
| |
6. long __stdcall Convert(long id) |
| |
Description: |
| |
Start convert PS/EPS to PDF file |
| |
Parameters: |
| |
id : A handle of PS Converter.. |
| |
Return Value: |
| |
Succed if the return value exceeds 0, or it is failed. |
| |
Here are several simple examples to make C. For more examples, you can refer to the directory "example". |
| |
1. Converting multiple PS/EPS files to one PDF file. |
| |
long id = CreatePDF(d:\\test\\out.pdf); |
| |
if( id > 0 ) { |
| |
AddPS(id, d:\\test\\input1.ps); |
| |
AddPS(id, d:\\test\\inputn.ps); |
| |
Convert(id); |
| |
ClosePDF(id); |
| |
} |
| |
|
| |
2. Converting PS/EPS files to encrypted PDF files. |
| |
long id = CreatePDF(d:\\test\\out.pdf); |
| |
if( id > 0 ) { |
| |
SetPDFSecurity( id , 128 , 0 ,"user" , "owner" ); |
| |
AddPS(id, d:\\test\\input1.ps); |
| |
AddPS(id, d:\\test\\inputn.ps); |
| |
Convert(id); |
| |
ClosePDF(id); |
| |
} |
| |
|