Skip to content

Add option to relocate /data directory #1616

Open

Description

@crystalfp

Feature Request

Feature description

Add an optional parameter to the constructor containing the data directory. If absent the directory defaults to __dirname/data.

Around line 5814 add: this.dataDir = options.dataDir || "__dirname/data";
Change the 15 lines containing __dirname accordingly.

This change is useful because in an ElectronJS application bundled by Vite the __dirname points to dist-electron but the data dir is /node_modules/pdfkit/js/data and haven't found a way to relocate it to dist-electron.

Thanks!

Activity

  1. blikblum commented on Apr 25, 2025

    @blikblum
    Member

    This is a workaround

    I will do a properly fix (do not rely on fs on non browser environments)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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