변환 이미지가 PDF 파일에 약간의 문제가 있습니다.어떻게 자바 서블릿에서 이미지를 pdf로 변환 할 수 있습니까?
나는 하나의 이미지를 pdf로 변환 했으므로 여러 개의 이미지를 하나의 pdf 파일로 변환하려고합니다.
pdf 작성을 위해 itext 라이브러리를 사용하고 있습니다.
이것은 하나의 이미지로 하나의 pdf를 작성하는 코드입니다.
Document convertJpgToPdf=new Document();
//Create PdfWriter for Document to hold physical file
PdfWriter.getInstance(convertJpgToPdf, new FileOutputStream("D:\\PDF_Path\\ConvertImagetoPDF.pdf"));
convertJpgToPdf.open();
// Write Somethinf into that File
convertJpgToPdf.add(new Paragraph("Welcome, Your Input Image is Converted to PDF, Save the File"));
convertJpgToPdf.add(new Paragraph("PDF Produced by Converting Image to PDF as Servlet"));
//Get the input image to Convert to PDF
Image convertJpg=Image.getInstance(uploadPath);
//Add image to Document
convertJpgToPdf.add(convertJpg);
//Close Document
convertJpgToPdf.close();
내 문제는 그 폴더 내가 하나의 PDF 파일로 모든 이미지,
PDF File Header
image1
image2
..........
..........
imageN
처럼하는 것이 가능하다는 것을 변환 할 수있는 방법을 10 개 개의 이미지를 포함, 내가 하나 개의 폴더가 있었다. 도와주세요. 미리 감사드립니다.
이를 참조하십시오 작업의 : http://bigsnowball.com/content/create-multi-page-pdf-scanned-fax-images-java-using -itext – Susai