aboutsummaryrefslogtreecommitdiffstats
path: root/print.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2004-04-22 17:03:21 +0000
committerUlf Lamping <ulf.lamping@web.de>2004-04-22 17:03:21 +0000
commit51f987e04f063251198154e2691a99b6281d7c71 (patch)
tree2a5868f2792d840973716841f329adca8e79f3b7 /print.c
parentf205304ed4b63be05dfd8f8ee1e989e75c773148 (diff)
added some options and enhancements to the print output:
-ps: added formatting hints for ghostscript, so pdf conversion will be much better -ps: print a thin line at the top and bottom of each page -ps/text: add an option to start a new page for every packet (formfeed) svn path=/trunk/; revision=10660
Diffstat (limited to 'print.c')
-rw-r--r--print.c54
1 files changed, 51 insertions, 3 deletions
diff --git a/print.c b/print.c
index b82358b9c5..d463d0e0e8 100644
--- a/print.c
+++ b/print.c
@@ -1,7 +1,7 @@
/* print.c
* Routines for printing packet analysis trees.
*
- * $Id: print.c,v 1.77 2004/04/20 22:34:08 ulfl Exp $
+ * $Id: print.c,v 1.78 2004/04/22 17:03:20 ulfl Exp $
*
* Gilbert Ramirez <gram@alumni.rice.edu>
*
@@ -715,8 +715,9 @@ print_preamble(FILE *fh, gint format, gchar *filename)
break;
case(PR_FMT_PS):
print_ps_preamble(fh);
- fputs("%% Set the font to 8 point\n", fh);
- fputs("/Courier findfont 8 scalefont setfont\n", fh);
+
+ fputs("%% Set the font to 10 point\n", fh);
+ fputs("/Courier findfont 10 scalefont setfont\n", fh);
fputs("\n", fh);
fputs("%% the page title\n", fh);
ps_clean_string(psbuffer, filename, MAX_PS_LINE_LENGTH);
@@ -738,6 +739,53 @@ print_preamble(FILE *fh, gint format, gchar *filename)
}
}
+void
+print_packet_header(FILE *fh, gint format, guint32 number, gchar *summary) {
+ char psbuffer[MAX_PS_LINE_LENGTH]; /* static sized buffer! */
+
+
+ switch(format) {
+ case(PR_FMT_TEXT):
+ /* do nothing */
+ break;
+ case(PR_FMT_PS):
+ ps_clean_string(psbuffer, summary, MAX_PS_LINE_LENGTH);
+ fprintf(fh, "[/Dest /__frame%u__ /Title (%s) /OUT pdfmark\n", number, psbuffer);
+ fputs("[/View [/XYZ -4 currentpoint matrix currentmatrix matrix defaultmatrix\n", fh);
+ fputs("matrix invertmatrix matrix concatmatrix transform exch pop 20 add null]\n", fh);
+ fprintf(fh, "/Dest /__frame%u__ /DEST pdfmark\n", number);
+ break;
+ case(PR_FMT_PDML):
+ /* do nothing */
+ break;
+ case(PR_FMT_PSML):
+ /* do nothing */
+ break;
+ default:
+ g_assert_not_reached();
+ }
+}
+
+void
+print_formfeed(FILE *fh, gint format) {
+ switch(format) {
+ case(PR_FMT_TEXT):
+ fputs("\f", fh);
+ break;
+ case(PR_FMT_PS):
+ fputs("formfeed\n", fh);
+ break;
+ case(PR_FMT_PDML):
+ /* do nothing */
+ break;
+ case(PR_FMT_PSML):
+ /* do nothing */
+ break;
+ default:
+ g_assert_not_reached();
+ }
+}
+
/* Some formats need stuff at the end of the output */
void
print_finale(FILE *fh, gint format)