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

Suggestion: Add method chaining for PDPageContentStream

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.0.0 PDFBox
    • None
    • Writing
    • None
    • Patch

    Description

      **This patch is a byproduct of my other contributions. I wanted to simplify the creation of new PDF via PDFBox and I like method chaining.

      This is not a major contribution whatsoever and does not really add new functionality.
      But instead of letting this rot in a shelf or some local mirror, I could just suggest it here.

      It allows chaining the different methods of PDPageContentStreams / PDAbstractContentStreams.

      Without method chaining:

      With method chaining:

      If this patch is not beneficial or uninteresting simply close this issue.

      Be aware though:
      This is based on bold typecasts. If you wanted to include this, this is something I could possibly fix:

      Also be aware:
      This is a quick and dirty solution and does not include other stream types, that may extend PDAbstractContentStream.
      If you were interested - please tell me so I can check that and clean it up.

      This is not fit for direct inclusion and would require some cleanup first!

      Attachments

        1. image-2021-09-15-13-53-20-550.png
          63 kB
          Christian Appl
        2. image-2021-09-15-13-54-13-203.png
          51 kB
          Christian Appl
        3. image-2021-09-15-14-01-54-602.png
          25 kB
          Christian Appl
        4. Method_chaining_for_PDPageContentStream.patch
          50 kB
          Christian Appl

        Activity

          People

            Unassigned Unassigned
            capSVD Christian Appl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: