* @throws IOException if there is some problem reading or writing the PDF data
     * @return The length of the PDF file saved
     */
    public long saveToOutputStream(OutputStream out) throws IOException {
        long documentLength = writeToOutputStream(out);
        long appendedLength = appendIncrementalUpdate(out, documentLength);
        return documentLength + appendedLength;
    }