メモリにPDF文書を作成する必要があります。私はpdfboxを使用しています。メモリにPDF文書を作成する
これは私のコードですが、ディスク上にドキュメントを作成します。 M.Prokhorov @として
public PDDocument generatePDF(String name, String v1, String v2, String v3, String v4) {
PDPageContentStream contentStream = null;
PDDocument document = null;
try {
document = new PDDocument();
PDPage page = new PDPage();
document.addPage(page);
contentStream = new PDPageContentStream(document, page);
fillDataInPDF(...);
corpPDF(page);
} catch (IOException err) {
LOG.error("Error occured .");
} finally {
if (contentStream != null) {
try {
contentStream.close();
} catch (IOException e) {
LOG.error("Error occured .");
}
}
}
return document;
}
私はそれをメモリに作成するというあなたの願いを認めます。あなたはそれを実際にやったことがあるのですか? –
私はディスク上に作成した、メモリ内での処理方法を知らない。 – singhal
コードサンプルにディスク上に作成されたことが示唆されるものは何もありません。 –