joseluisq / printd

Print HTML elements or pages in modern browsers.
MIT License
80 stars 5 forks source link

Print a vue route with params #17

Open vargas11 opened 2 years ago

vargas11 commented 2 years ago

Expected Behavior

it's possible to printURL with params?

I have this dynamic endpoint ${process.env.API_URL}/invoice/${this.invoice.id} but I got 404 not found, but if I change the url to a string said http://127.0.0.1:8080/invoice/13, I am able to see invoice.

d.printURL(`${process.env.API_URL}/invoice/${this.invoice.id}`, ({ launchPrint }) => {
    console.log("Content loaded!");
    // fire printing!
    launchPrint();
  });

...

Actual Behavior

...

Steps to Reproduce the Problem

  1. ...
  2. ...
  3. ...

Workaround

...

Specifications

joseluisq commented 2 years ago

BTW Are you using maybe Chrome ? if so what version are you using?

vargas11 commented 2 years ago

Yes I am using chrome Version 98.0.4758.80 (Official Build) (x86_64)

joseluisq commented 2 years ago

Looks like it's something with your ${process.env.API_URL}/invoice/${this.invoice.id} endpoint and I see it as not related with Printd. What I recommend is that you have to debug your endpoint and ensure it is valid or if you want you can share an example to be able to reproduce the issue.

mech01nc01 commented 1 year ago

try:

let url=`${process.env.API_URL}/invoice/${this.invoice.id}`;
console.warn('printing url: ', url);
d.printURL(url, ({ launchPrint }) => {
    console.log("Content loaded!");
    // fire printing!
    launchPrint();
  });

what do you get from the console.warn?