public static int office2pdf(String srcPath, String tgtPath) {
		conn = new SocketOpenOfficeConnection(openOfficeListenerPort);

		synchronized (conn) {
			try {
				File srcFile = new File(srcPath);
				File tgtFile = new File(tgtPath);
				DefaultDocumentFormatRegistry formatRegistry = new DefaultDocumentFormatRegistry();
				DocumentFormat pdf = formatRegistry
						.getFormatByFileExtension("pdf");
				conn.connect();
				DocumentConverter converter = new OpenOfficeDocumentConverter(
						conn);
				converter.convert(srcFile, tgtFile, pdf);
			} catch (Exception e) {
				log.info("调用OpenOffice转换失败:" + e.getMessage());
			} finally {
				if (conn != null) {
					conn.disconnect();
					conn = null;
				}
			}
		}
		return TRANSFERFAILURE;
	}