// Font setting, c: \ windows \ fonts \ kaiu. TTF, Chinese font
Basefont bfchinese = basefont. createfont (@ "C: \ WINDOWS \ fonts \ kaiu. TTF", basefont. identity_h, basefont. not_embedded );
Font chfont = new font (bfchinese, 12 );
Font chfont_blue = new font (bfchinese, 40, Font. Normal, new basecolor (51, 0,153 ));
Font chfont_msg = new font (bfchinese, 12, Font. italic, basecolor. Red );
String filename = httpruntime. appdomainapppath + "pdf/" + datetime. Now. tostring ("yyyymmddhhmmss") + ". pdf ";
Document document = new document (pagesize. a4.rotate ());
Specified writer upload writer = Specified writer. getinstance (document, new filestream (filename, filemode. Create ));
// Encryption
// Cipher writer. setencryption (Cipher writer. strength128bits, "1234", "1244", cipher writer. allow_copy | cipher writer. allowprinting );
Document. open ();
Document. addauthor ("zero ");
Document. Add (new paragraph ("whether to zoom in or not", chfont_blue); // call the overload function public paragraph (string STR, Font font); upload the font
Image IMG = image. getinstance (httpruntime. appdomainapppath + "img/1.jpg ");
Document. Add (IMG );
// Header footer = new header ();
Document. addheader ("footer", "this is footer ");
// Define writer. Dispose ();
// Reset writer. Close ();
Document. Dispose ();
Document. Close ();
Context. response. Write (filename );