| Subject: | PDF prinitng using PDFlib |
Hi,
I am using PDFlib to process and print PDF. But I didn't get function which exposed printing of PDF.
I wrote this code but got an exception that this function create_action() can not be used in object scope.
Can someone please help.
Thanks,
Akash
int print()
{
/* This is where the data files are. Adjust as necessary. */
string searchpath = "../../data";
PDFlib *p;
p = new PDFlib();
string pdfinput = "e:\\work\\2.pdf";
string docoptlist = "requiredmode=minimum infomode=true password=akash";
int count, pcosmode;
int i, doc;
string objtype;
// This means we must check return values of load_font() etc.
p->set_parameter("errorpolicy", "return");
p->set_parameter("SearchPath", searchpath);
/* We do not create any output document, so no call to
* begin_document() is required.
*/
/* Open the input document */
if ((doc = p->open_pdi_document(pdfinput, docoptlist)) == -1) {
cerr << "Error: " << p->get_errmsg() << endl;
return 2;
}
p->create_action("Launch", "print");
/* --------- general information (always available) */
}
| Posted: 12 Mar 2009 11:24 PM |
|