Skip to content

Wrong paper size computation #976

@troosan

Description

@troosan

Concerning PHPWord/Style/Paper, the conversion from mm -> twip is incorrect.
At line 163, the rate is set to 56.5217 whereas it should be 56.692913386.

It seems that for A4, the end result is correct (thanks to rounding I suppose) but if I add an entry for B5 in the list of sizes, the computed value is 1 mm off once you open it in word, and as a consequence word is not detecting it as B5 but as a custom size.

Solutions are to either

  • just correct the rate
  • use the PHPWord/Shared/Converter which does the job correctly
  • manually set the paper size, not using the official names (A4, B5, ...), but I haven't found how ...

Shall I create a pull request for this or is there another way to use custom sizes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions