Skip to content

Allow multiple Print Areas per worksheet #1041

@AlexanderPruss

Description

@AlexanderPruss

I would like to add the ability to save multiple print areas per worksheet to exceljs.

As seen in this Microsoft Excel documentation, excel sheets can have multiple print areas, but the pageSetup of a sheet currently only accepts a single print area. Or rather, printArea accepts a string, but the workbook-xform assumes that this string has only a single print area and parses it accordingly.

I see two straightforward solutions -

  • allow printArea to contain multiple print areas with a separator. Something like printArea:= B2:C5&&B7:C9 would specify two rectangles to print.
  • add an additional property printAreas that contains an array of print area strings.

I think the first one is better. A separator isn't super clean, but it's better than duplicating the property and is backwards compatible. I'll see if I can get an example PR up sometime soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions