ppd_emit_to_file, ppd_emit_to_fd - Output device specific code.
#include <ppd/ppd.h> gboolean ppd_emit( PpdFile * ppd,FILE *fp,PpdSectionOrder section ); gboolean ppd_emitfd( PpdFile * ppd, int fd,PpdSectionOrder section );
The sections PPD_ORDER_DOCUMENT and PPD_ORDER_PAGE will also output code from the PPD_ORDER_ANY section.
Once a code section has been emitted it is marked as such and will not be emitted unless it is re-marked.
/* Setup code to emitted */
ppd_mark_defaults(ppd);
ppd_mark_option(ppd,"Duplex","DuplexNoTumble");
ppd_mark_option(ppd,"PageSize","A4");
/* Emit initial code (including any reset and JCL code) */
ppd_emit_to_file(ppd,stdout,PPD_ORDER_EXIT);
fputs(ppd->jcl_begin->str,stdout);
ppd_emit_to_file(ppd, stdout, PPD_ORDER_JCL);
fputs(ppd->jcl_ps->str, stdout);
/* Any header comments go here */
...
/* Prolog section */
printf("%%%%BeginProlog);
ppd_emit_to_file(ppd, stdout, PPD_ORDER_PROLOG);
printf("%%%%EndProlog);
/* Setup section */
printf("%%%%BeginSetup);
ppd_emit_to_file(ppd, stdout, PPD_ORDER_DOCUMENT);
printf("%%%%EndSetup);
/* Main document begins */
for (...) {
printf("%%%%Page: 1 1);
/* Re-mark so that this is emitted on each page */
ppd_mark_option(ppd,"PageSize","A4");
printf("%%%%PageSetup);
ppd_emit_to_file(ppd, stdout, PPD_ORDER_PAGE);
printf("%%%%EndPageSetup);
/* Page info goes here */
...
}
/* Send ending JCL code */
fputs(ppd->jcl_end->str,stdout);
|
Закладки на сайте Проследить за страницей |
Created 1996-2025 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |