Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text layer issue #53

Closed
JoseCadenas opened this issue Sep 5, 2023 · 4 comments · Fixed by #56
Closed

Text layer issue #53

JoseCadenas opened this issue Sep 5, 2023 · 4 comments · Fixed by #56

Comments

@JoseCadenas
Copy link

Hello,

I am running version 1.7.2 and am experiencing an issue with text-layer, the text is rendering below the pdf preview.

Text layer on:
Screenshot 2023-09-05 at 1 00 44 PM

Text layer off:
Screenshot 2023-09-05 at 1 00 33 PM

If thats the expected behavior, then so be it but i recall in 1.5.1 it behaving differently. Thank you anyhow for taking a look into this for me.

Regards,
Jose

@TaTo30
Copy link
Owner

TaTo30 commented Sep 7, 2023

The implementation of layers has changed a bit since v1.6, now you need to import css styles for layers work properly.

import '@tato30/vue-pdf/style.css'

@JoseCadenas
Copy link
Author

Hey Aldo,

Thanks for the help, I didn't notice that change. However, with that import I still encounter an issue.

import "@tato30/vue-pdf/style.css";

Results in this error Module not found: Error: Package path ./style.css is not exported from package /Users/jose/Documents/GitHub/ERP/node_modules/@tato30/vue-pdf (see exports field in /Users/jose/Documents/GitHub/ERP/node_modules/@tato30/vue-pdf/package.json)

I modified @tato30/vue-pdf package.json exports object based on the error log above and it works:

  "exports": {
    ".": {
      "require": "./dist/index.umd.js",
      "import": "./dist/index.mjs",
      "types": "./dist/types/index.d.ts"
    },
    "./*.css": "./dist/*.css",                     <---- I added this line
    "./**/*.css": "./dist/*.css",
    "./src/*": "./src/*"
  },

Let me know if I should provide more information or what I can do to make text layers work without package.json modification. Again I appreciate the help!

Jose

@TaTo30
Copy link
Owner

TaTo30 commented Sep 13, 2023

Fixed.

I was misunderstanding on how npm handles the path wildcards, thanks for catch the error.

@JoseCadenas
Copy link
Author

Updated and works as expected

Im glad I could help. Thank you for VuePDF!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants