This is what I want to do:
I know how to do this if I save # 1 to a local hard drive on the server side and upload files for # 2. But I want to use "directly from memory". I searched all the methods from these pdfbox but still could not find it.
This is my code derived from a local file
Thanks.
import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import org.apache.pdfbox.exceptions.COSVisitorException; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.edit.PDPageContentStream; import org.apache.pdfbox.pdmodel.font.PDFont; import org.apache.pdfbox.pdmodel.font.PDTrueTypeFont; import org.apache.pdfbox.pdmodel.font.PDType1Font; import org.apache.pdfbox.util.PDFMergerUtility; public class Test2 { public void doIt(final String file, final String message) throws IOException, COSVisitorException {
source share