Question:I am trying to add some C++to my PDF creation process to save some time. My goal is to basically click a button generate a PDF and have it print.The only problem is that I don't know how to set the number of copies to print. I want pass a variable and print that many copies. The problem is that I can't really find any documentation of any software which discusses the methods here. Is there any solution to this problem on VeryPDF?
Answer: According to your needs, I guess you have a free trial of this software: VeryPDF PDFPrint SDK, by which you can pass a variable and print that many copies when developing. And this software is professional for developing, by it you can find more functions which is helpful for further developing. By the SDK version, you can call it from C++ easily. Meanwhile this software allows you to call it together with VB .NET, MS Visual Basic, Borland Delphi, VBA (MS Office products such as Access) and C++ via COM, C and C++ via native C. Please check more information of this software on homepage, in the following part, let us check how to use this software.
Step 1. Free download PDFPrint SDK
- For uploading and downloading easily, we have compressed it to zip file. When downloading finishes, please extract it to some folder.
- Please note this is Window application, it can work under all the Window system both of 32-bit and 64-bit.
Step 2. Print PDF and set number of copies in developing.
- Here are some parameters which will be helpful for you, please have a check.
-copies <int> : set number of copies to print
-setcopyto : set '-copies' value to printer instead of print it several times
-duplex <int> : select duplex or double-sided printing for printers capable of duplex printing,
1 : simplex
2 : horizontal
3 : vertical
-shell : Call default PDF viewer to file
-shell2 : Call default PDF viewer to file
-shelltime <int> : set timeout for shell printing,in milliseconds
-chgbin <int> : change bin/tray for printer by number
-papersource <string>: change bin/tray for printer by name
-settraytopclfile <string>: set tray to PCL file directly, only work when '-papersource' used
-wtext <string> : watermark on printed document
-wtype <int> : type of watermark
- When call this software from C++, please refer to the following code template:
void main(int argc, char *argv)
if(argc != 2)
char *lpPDFName = argv;
char *lpRegcode = "XXXXXXXXXXXXXXXXXXXX";
sprintf(szCommandLine,"pdfprint -quiet -getpagecount \"%s\""
int nPageCount = VeryPDF_PDFPrint(szCommandLine);
printf("PageCount = %d\n", nPageCount);
sprintf(szCommandLine,"pdfprint \"-$\" \"%s\" -pdforient 4
-copies 2 -scaley -1 \"%s\"", lpRegcode,lpPDFName);
int nRet = VeryPDF_PDFPrint(szCommandLine);
printf("Return Value = %d\n",nRet);
By this method, you can print PDF and set number of copies. During the using, if you have any question, please contact us as soon as possible.