r5586 - trunk/eda/fped

werner at docs.openmoko.org werner at docs.openmoko.org
Sun Aug 30 21:38:33 CEST 2009


Author: werner
Date: 2009-08-30 21:38:33 +0200 (Sun, 30 Aug 2009)
New Revision: 5586

Modified:
   trunk/eda/fped/postscript.c
Log:
- postscript.c: added outline information for PDF
- postscript.c: ignore pdfmark if not supported by interpreter



Modified: trunk/eda/fped/postscript.c
===================================================================
--- trunk/eda/fped/postscript.c	2009-08-30 18:39:46 UTC (rev 5585)
+++ trunk/eda/fped/postscript.c	2009-08-30 19:38:33 UTC (rev 5586)
@@ -625,7 +625,7 @@
 }
 
 
-static void ps_page(FILE *file, int page)
+static void ps_page(FILE *file, int page, const struct pkg *pkg)
 {
 	fprintf(file, "%%%%Page: %d %d\n", page, page);
 
@@ -638,6 +638,7 @@
 "    72 %d div 1000 div dup scale\n",
     (int) MIL_UNITS);
 	fprintf(file, "%%%%EndPageSetup\n");
+	fprintf(file, "[ /Title (%s) /OUT pdfmark\n", pkg->name);
 }
 
 
@@ -676,7 +677,7 @@
 	unit_type c, d;
 	int done;
 
-	ps_page(file, page);
+	ps_page(file, page, pkg);
 	ps_header(file, pkg);
 
 	x = 2*PAGE_HALF_WIDTH-2*PS_DIVIDER_BORDER;
@@ -921,6 +922,17 @@
 	fprintf(file,
 "/boxfont { 4 copy 1000 maxfont maxfont scalefont setfont } def\n");
 
+	/*
+	 * Ignore pdfmark. From
+	 * http://www.adobe.com/devnet/acrobat/pdfs/pdfmark_reference.pdf
+	 * Page 10, Example 1.1.
+	 */
+
+	fprintf(file,
+"/pdfmark where { pop }\n"
+"    { /globaldict where { pop globaldict } { userdict } ifelse"
+"    /pdfmark /cleartomark load put } ifelse\n");
+
 	fprintf(file, "%%%%EndProlog\n");
 }
 




More information about the commitlog mailing list