From: eeandrew@pyr.swan.ac.uk (e c andrews)
Subject: patch to give correct positioning with laserjet + or II
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 21 Aug 1992 21:10:02 GMT

Here are my (fairly hacky) mods to give correct page positioning for the
laserjet and ljetplus drivers.

There are only very simple changes, the hard bit is all the faffing around
getting the right numbers. These values here correctly position dvips's test
page, but aren't really ideal for my latex stuff. Oh well.... Anyone with
better values, please tell...

Anyway, diffs follow,

Eddy Andrews
eeandrew@pyr.swan.ac.uk

*** gdevdjet.c	Fri Aug 21 18:26:13 1992
--- gdevdjet.c.distrib	Fri Aug 21 13:55:04 1992
***************
*** 61,90 ****
  #define DESKJET_MARGINS_LETTER	0.25, 0.40, 0.25, 0.40
  #define DESKJET_MARGINS_A4	0.15, 0.40, 0.15, 0.05
  
- /* Now EA's hacky guess at A4 size
-  * BEWARE: I've only really adjusted things to get a test page (from dvips)
-  * printed correctly, so only the LEFT and TOP A4 values are correct. The
-  * others are pure guesses based on the DESKJET values
-  * These values work OK on the hp laserjet2 and the laserjet+ emulator that I
-  * can test
-  */
- /* These values generated to match dvips's test page */
- #define LASERJET_MARGINS_A4	0.25, 0.20, 0.25, 0.00
- #define LASERJET_MARGINS_LETTER	0.35, 0.20, 0.35, 0.00
- /* These values match a normal dvijep page with dvips&gs*/
- /* #define LASERJET_MARGINS_A4	0.02, 0.20, 0.25, -0.13 */
- /* #define LASERJET_MARGINS_LETTER	0.35, 0.20, 0.35, 0.00 */
- 
  #ifndef A4
  #  define WIDTH_10THS		85
  #  define HEIGHT_10THS		110
  #  define DESKJET_MARGINS	DESKJET_MARGINS_LETTER
- #  define LASERJET_MARGINS	LASERJET_MARGINS_LETTER
  #else
  #  define WIDTH_10THS		83	/* 210mm */
  #  define HEIGHT_10THS		117	/* 297mm */
  #  define DESKJET_MARGINS	DESKJET_MARGINS_A4
- #  define LASERJET_MARGINS	LASERJET_MARGINS_A4
  #endif
  
  /* The number of blank lines that make it worthwhile to reposition */
--- 61,74 ----
***************
*** 185,190 ****
--- 169,175 ----
  	if ( ppdev->print_page == djet_print_page ||
  	     ppdev->print_page == djet500_print_page
  	   )
+ #undef ppdev
  	{	static const float m_a4[4] = { DESKJET_MARGINS_A4 };
  		static const float m_letter[4] = { DESKJET_MARGINS_LETTER };
  		const float _ds *m =
***************
*** 194,212 ****
  		pdev->b_margin = m[1];
  		pdev->r_margin = m[2];
  		pdev->t_margin = m[3];
- 	} else if ( ppdev->print_page == ljet_print_page ||
- 		    ppdev->print_page == ljetplus_print_page
- 	   )
- #undef ppdev
- 	{	static const float m_a4[4] = { LASERJET_MARGINS_A4 };
- 		static const float m_letter[4] = { LASERJET_MARGINS_LETTER };
- 		const float _ds *m =
- 			(gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? m_a4 :
- 			 m_letter);
- 		pdev->l_margin = m[0];
- 		pdev->b_margin = m[1];
- 		pdev->r_margin = m[2];
- 		pdev->t_margin = m[3];
  	}
  	return gdev_prn_open(pdev);
  }
--- 179,184 ----
***************
*** 344,350 ****
  				fputs("W", prn_stream);
  			   }
  			   else
! 			   {	fprintf(prn_stream, "\033*p+%dY", num_blank_lines);
  			   }
  			}
  			num_blank_lines = 0;
--- 316,322 ----
  				fputs("W", prn_stream);
  			   }
  			   else
! 			   {	fprintf(prn_stream, "\033*b%dY", num_blank_lines);
  			   }
  			}
  			num_blank_lines = 0;

Newsgroups: gnu.ghostscript.bug