java²Ù×÷pdf
È»jacobÖÐÒ²ÓйØÓÚPDFµÄ·½·¨£¬µ«ÊǹýÓÚ¸´ÔÓ¡£iTextÊÇÒ»¸ö¿ªÔ´µÄPDF¹¤¾ß£¬Ð¡ÇɶøÓÖ±ã½Ý¡£
¹Ù·½ÍøÕ¾ÊÇ£ºhttp://www.lowagie.com/iText/
¹Ù·½µÄ½âÊÍ£ºiText is a library that allows you to generate PDF files . the fly
×îа汾Ϊ£º2.1.5
ÏÂÔØµØÖ·ÊÇ£ºhttp://nchc.dl.sourceforge.net/sourceforge/itext/iText-2.1.5.jar
ÎҵĿª·¢»·¾³:JDK1.6+MyEclipse7+Tomcat5.5.27
Ê×ÏÈÔÚMyEclipseÖÐн¨Ò»¸öÏîÄ¿£¬Ãû³ÆÎªiText¡£
н¨Ò»¸öClass£¨ÀࣩHelloWorld.java £¬Package£¨°ü£©Îªcom.test £¬´úÂëÈçÏ£º
package com.test;
import java.io.FileOutputStream;
import java.io.IOException;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;
public class HelloWorld {
/**
* Éú³ÉÒ»¸ö¼òµ¥µÄPDFÎļþ£ºHelloWorld.pdf
*
* ×÷ÕߣºÐ¡¶Î
*/
public static void main(String[] args) {
System.out.println("Hello World");
//µÚÒ»²½£º´´½¨Ò»¸ödocument¶ÔÏó¡£
Document document = new Document();
try {
// µÚ¶þ²½£º
// ´´½¨Ò»¸öPdfWriterʵÀý£¬
// ½«ÎļþÊä³öÁ÷Ö¸ÏòÒ»¸öÎļþ¡£
PdfWriter.getInstance(document,new FileOutputStream("C:\\HelloWorld.pdf"));
// µÚÈý²½£º´ò¿ªÎĵµ¡£
document.open();
// µÚËIJ½£ºÔÚÎĵµÖÐÔö¼ÓÒ»¸ö¶ÎÂä¡£
document.add(new Paragraph("Hello World"+","+"Hello iText"+","+"Hello xDuan"));
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
}
// µÚÎå²½£º¹Ø±ÕÎĵµ¡£
Ïà¹ØÎĵµ£º
Ö±½Óͨ¹ýmainÈë¿Ú:
argumentsÉèÖãº-Djava.library.path=¶¯Ì¬¿âËùÔÚĿ¼
ÔÚLinuxÉϵ÷.soÎļþ£º.soÎļþ ±ØÐëÃüÃûΪ£ºlibXXX.so,È磺libJni.so
ÔÚWindowsÉϵ÷.dllÎļþ£º.dllÎļþ ÃüÃû²»Òª¼Ólib,Ö±½ÓÃüÃûΪ£ºXXX.dll È磺Jni.dll
Àý£º
¶¯Ì¬¿â£ºlibJniNassirDecrypt.so »ò JniNassirDecrypt.dll
javaµ÷Óö¯Ì¬¿â´úÂë:
Str ......
C/C++
/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê4ÔÂ29ÈÕ, ÉÏÎç9:46
*/
#include <iostream>
using namespace std;
int maximum(int[], int);
int main(int argc, char** argv) {
// int sg[3][4] = {
int sg[][4] = {
{68, 77, 73, 86},
{87, 96, 7 ......
/**
* »ñÈ¡·þÎñÆ÷µÄwebµØÖ·
* @return
*/
private String getWebPath(){
String _tempStr = Thread.currentThread().getContextClassLoader().getResource("").toString();
_tempStr=_tempStr.substring ......
ÕâÆªÎÄ×ÖдµÄºÜºÃ£¬ÍƼö¸ø×Ô¼ººÍ´ó¼Ò£¡
ÊÂÎñ²ßÂÔ: Á˽âÊÂÎñÏÝÚå
ÔÚ Java ƽ̨ÖÐʵÏÖÊÂÎñʱҪעÒâµÄ³£¼û´íÎó
¼¶±ð£º Öм¶
Mark Richards, Ö÷¹ÜºÍ¸ß¼¶¼¼Êõ¼Ü¹¹Ê¦, Collaborative Consulting, LLC
2009 Äê 3 ÔÂ 06 ÈÕ
ÊÂÎñ´¦ÀíµÄÄ¿±êÓ¦¸ÃÊÇʵÏÖÊý¾ÝµÄ¸ß¶ÈÍêÕûÐÔºÍÒ»ÖÂÐÔ¡£±¾ÎÄÊÇΪ Java ƽ̨¿ª· ......