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

Protect PDDocumentCatalog constructors

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0 PDFBox
    • Fix Version/s: 3.0.0 PDFBox
    • Component/s: PDModel
    • Labels:
      None

      Description

      A guy on the user mailing list used this code:

      PDDocumentCatalog pg = new PDDocumentCatalog(mergedPDF) ;
      PageMode pm = PageMode.USE_OUTLINES;
      pg.setPageMode(pm);
      

      This destroyed his PDF. The only usages of the constructors are internal to PDFBox, when a document is newly created or opened. My first thought was to make the constructor package local to avoid people using this, but it would prevent subclassing (although I can't imagine why anybody would do that), so I'll make it protected instead.

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              tilman Tilman Hausherr
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: