final int tabSize = buffer.getTabSize() *
final int _tabSize = buffer.getTabSize() *
	public void actionPerformed(ActionEvent evt)	{		View view = getView(evt);		Buffer buffer = view.getBuffer();		PrintJob job = view.getToolkit().getPrintJob(view,buffer			.getName(),null);		if(job == null)			return;		int topMargin;		final int leftMargin;		int bottomMargin;		int rightMargin;		int ppi = job.getPageResolution();		try		{			topMargin = (int)(Float.valueOf(jEdit.getProperty(				"buffer.margin.top")).floatValue() * ppi);		}		catch(NumberFormatException nf)		{			topMargin = ppi / 2;		}		try		{			leftMargin = (int)(Float.valueOf(jEdit.getProperty(				"buffer.margin.left")).floatValue() * ppi);		}		catch(NumberFormatException nf)		{			leftMargin = ppi / 2;		}		try		{			bottomMargin = (int)(Float.valueOf(jEdit.getProperty(				"buffer.margin.bottom")).floatValue() * ppi);		}		catch(NumberFormatException nf)		{			bottomMargin = topMargin;		}		try		{			rightMargin = (int)(Float.valueOf(jEdit.getProperty(				"buffer.margin.right")).floatValue() * ppi);		}		catch(NumberFormatException nf)		{			rightMargin = leftMargin;		}		String header = view.getTitle();		Element map = buffer.getDefaultRootElement();		SyntaxTextArea textArea = view.getTextArea();		final int tabSize = buffer.getTabSize() *			textArea.getToolkit().getFontMetrics(textArea.getFont())			.charWidth('m');		SyntaxView syntaxView = new SyntaxView(map) {			public float nextTabStop(float x, int tabOffset)			{				return ((((int)x - leftMargin) / tabSize + 1)					* tabSize) + leftMargin;			}		};		Graphics gfx = null;		Font font = textArea.getFont();		int fontHeight = font.getSize();		Dimension pageDimension = job.getPageDimension();		int pageWidth = pageDimension.width;		int pageHeight = pageDimension.height;		int y = 0;		for(int i = 0; i < map.getElementCount(); i++)		{			if(gfx == null)			{				gfx = job.getGraphics();				gfx.setFont(font);				FontMetrics fm = gfx.getFontMetrics();				gfx.setColor(Color.lightGray);				gfx.fillRect(leftMargin,topMargin,pageWidth					- leftMargin - rightMargin,					  fm.getMaxAscent()					  + fm.getMaxDescent()					  + fm.getLeading());				gfx.setColor(Color.black);				y = topMargin + fontHeight;				gfx.drawString(header,leftMargin,y);				y += fontHeight;			}			syntaxView.drawLine(i,gfx,leftMargin,y += fontHeight);			if((y > pageHeight - bottomMargin) ||				(i == map.getElementCount() - 1))			{				gfx.dispose();				gfx = null;			}		}		job.end();	}