Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3730

Encapsulate outputStream into BufferedOutputStream in PDDocument.save()

    Details

      Description

      I recognized very slow performance of PDDocument.save() with a FileOutputStream over a VPN connection.
      I did some testing and found out that using PDDocument.save(File file) solved the issue. So the BufferedInputStream makes the difference.

      Since my document API uses streams I encapsulate the OutputStream in a BufferedOutputStream if neccessary:

      if (!(outputStream instanceof BufferedOutputStream)) {
      outputStream = new BufferedOutputStream(outputStream);
      }

      pdDocument.save(outputStream);

      PDDocument.load() already does that with the InputStream. So I wonder if that would be an improvement for save(), too?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tilman Tilman Hausherr
                Reporter:
                pinnau Peter Pinnau
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: