Archive for August 24th, 2007

how to make N-up PDF with free software

The main benefit of N-up is to cut paper costs. For example, you can cut down your paper cost by 50% with 2-up printing / copying, and 75% with 4-up printing / copying etc. This feature is also useful for producing handouts and presentation notes.

some printers support N-up printing, but I just want to tell you a N-up software,

Usage: java nup_pdf [options]

infile : input PDF file
outfile : output PDF file
pages : number of pages per sheet. pages = 2^n * x^2

Options:
-b : draw bounding boxes
-m : outer margin (measured in points)
-s : spacing between pages (measured in points)
-k : 0=n-Up, 1=Booklet

(C) 2005 Marcus May (QuoVadis/NBS)

it bases on iText, you can download

      PDF N-UP Maker,compiled by gcj, does not jvm, only windows console version
      nup_pdf.jar, java version, can run at windows, linux, Mac OS X, need jre1.4 or over
      nup_pdf.java, source code, from qvPDF.
Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • BlinkList
  • blogmarks
  • blogtercimlap
  • connotea
  • DotNetKicks
  • Fark
  • Fleck
  • Gwar
  • Haohao
  • IndianPad
  • Internetmedia
  • LinkaGoGo
  • MyShare
  • Netscape
  • NewsVine
  • Rec6
  • Reddit
  • Scoopeo
  • Slashdot
  • StumbleUpon
  • Technorati
  • Webride

How to let SharpDevelop Reports support CJK encoding PDF export

Glad to know iTextSharp is used in SharpDevelop Reports, because iTextSharp supports CJK(maybe I should say it supports all encodings).

I downloaded SharpDevelopReports_2.2.0.263_Source and had a test, it does not support Chinese Characters, so I reviewed the source codes, I found the following lines,

if (this.StyleDecorator.Font.Unit == GraphicsUnit.Point) {

font = FontFactory.GetFont(this.StyleDecorator.Font.FontFamily.Name,
this.StyleDecorator.Font.Size,
(int)this.StyleDecorator.Font.Style);
} else {

font = FontFactory.GetFont(this.StyleDecorator.Font.FontFamily.Name,
new UnitConverter(this.StyleDecorator.Font.Size,XGraphicsUnit.Pixel).Point,
(int)this.StyleDecorator.Font.Style);
}

by default, it only supports “CP1250″, it can not show Chinese Characters correctly. I changed the codes to
if (this.StyleDecorator.Font.Unit == GraphicsUnit.Point) {

font = FontFactory.GetFont(this.StyleDecorator.Font.FontFamily.Name, BaseFont.IDENTITY_H,
this.StyleDecorator.Font.Size,
(int)this.StyleDecorator.Font.Style);
} else {

font = FontFactory.GetFont(this.StyleDecorator.Font.FontFamily.Name,BaseFont.IDENTITY_H,
new UnitConverter(this.StyleDecorator.Font.Size,XGraphicsUnit.Pixel).Point,
(int)this.StyleDecorator.Font.Style);
}

let it uses “IDENTITY_H”, and it can show Chinese now, of course it is not a good way, and I found JasperReports also stores pdfEncoding in report files , here is an example,

<font fontName=”Arial” size=”14″ pdfFontName=”ARIAL.TTF” pdfEncoding=”Identity-H” isPdfEmbedded=”true”/>


so how about sdr? btw, how about let SharpDevelope Reports supports JasperReports format? JasperReports format is very popular and mature now.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • BlinkList
  • blogmarks
  • blogtercimlap
  • connotea
  • DotNetKicks
  • Fark
  • Fleck
  • Gwar
  • Haohao
  • IndianPad
  • Internetmedia
  • LinkaGoGo
  • MyShare
  • Netscape
  • NewsVine
  • Rec6
  • Reddit
  • Scoopeo
  • Slashdot
  • StumbleUpon
  • Technorati
  • Webride