• R/O
  • R/W (SSH)
  • R/W (HTTPS)

opfc: コミット


コミットメタ情報

リビジョン920 (tree)
日時2012-01-20 20:07:46
作者sho-otani

ログメッセージ

(メッセージはありません)

変更サマリ

差分

--- pdftopdf/trunk/src/pdftopdf.cc (revision 919)
+++ pdftopdf/trunk/src/pdftopdf.cc (revision 920)
@@ -97,7 +97,8 @@
9797 !strcasecmp(attr->value, "yes")));
9898 }
9999
100-void emitJCLOptions(FILE *fp, int copies)
100+void emitJCLOptions(FILE *fp, int copies, const char *user, const char *title,
101+ const char *opt_string)
101102 {
102103 int section;
103104 ppd_choice_t **choices;
@@ -129,7 +130,11 @@
129130 fputs(attr->value,fp);
130131 datawritten = 1;
131132 } else if (pdftoopvp) {
132- fprintf(fp,"Copies=%d;",copies);
133+ if ((attr = ppdFindAttr(ppd,"pdftopdfJCLKeyCopies",NULL)) != NULL) {
134+ fprintf(fp,"%s=%d;",attr->value,copies);
135+ } else {
136+ fprintf(fp,"Copies=%d;",copies);
137+ }
133138 datawritten = 1;
134139 }
135140 }
@@ -152,6 +157,26 @@
152157 }
153158 }
154159 }
160+ if (pdftoopvp) {
161+ int num_options;
162+ cups_option_t *options;
163+ if ((attr = ppdFindAttr(ppd,"pdftopdfJCLKeyUser",NULL)) != NULL) {
164+ fprintf(fp,"%s=%s;",attr->value,user);
165+ datawritten = 1;
166+ }
167+ if ((attr = ppdFindAttr(ppd,"pdftopdfJCLKeyTitle",NULL)) != NULL) {
168+ fprintf(fp,"%s=%s;",attr->value,title);
169+ datawritten = 1;
170+ }
171+ num_options = cupsParseOptions(opt_string,0,&options);
172+ for (i = 0;i < num_options;i++) {
173+ snprintf(buf,sizeof(buf),"pdftopdfJCLKey%s",options[i].name);
174+ if ((attr = ppdFindAttr(ppd,buf,NULL)) != NULL) {
175+ fprintf(fp,"%s=%s;",attr->value,options[i].value);
176+ datawritten = 1;
177+ }
178+ }
179+ }
155180 if (datawritten) fputc('\n',fp);
156181 }
157182
@@ -721,7 +746,8 @@
721746 if (emitJCL) {
722747 ppdEmitJCL(ppd,stdout,P2PDoc::options.jobId,P2PDoc::options.user,
723748 P2PDoc::options.title);
724- emitJCLOptions(stdout,deviceCopies);
749+ emitJCLOptions(stdout,deviceCopies,
750+ P2PDoc::options.user,P2PDoc::options.title,argv[5]);
725751 }
726752 str = new P2POutputStream(stdout); /* PDF start here */
727753 p2pdoc->output(str,deviceCopies,deviceCollate);
旧リポジトリブラウザで表示