Skip to content

Allow to set text features to support rtl #89

@moshfeu

Description

@moshfeu

The way rtl is supported in pdfkit is by passing features prop to the text function

foliojs/pdfkit#219 (comment)

Please allow to pass the features props to the table function. Something like

const table = {
  title: "כותרת",
  subtitle: "Subtitle",
  headers: [ "Country", "Conversion rate", "Trend" ],
  rows: [
    [ "Switzerland", "12%", "+1.12%" ],
    [ "France", "67%", "-0.98%" ],
    [ "England", "33%", "+4.44%" ],
  ],
  textFeatures: ['rtla']
}

And pass it here

pdfkit-table/index.js

Lines 555 to 560 in 707a191

this.text(header,
lastPositionX + (cellPadding.left),
startY, {
width: Number(columnSizes[i]) - (cellPadding.left + cellPadding.right),
align: 'left',
});

When I think about it, allowing setting align is also a good idea

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions