Brilliant extension there @ben thanks for taking the time to do it - the video is excellent too, very helpful.
This could be extremely useful to me.
Will it work with injected JS dynamic content? I am rather suspecting not.
And another thing..would love to see a tutorial for the PDF streamer.
Yes, it works with injected JS dynamic content — as long as the content exists in the DOM at the moment you call preparePdf() .
The PDF generator doesn’t care how the content got there (App Connect, repeaters, conditional regions, JS injection, templating, etc). It only cares that the element with the given ID is present when the button is clicked.
So if your JS injection happens before the user triggers the PDF action, it will work perfectly.
The only time it wouldn’t work is if the content is injected after the PDF function runs — because then the element simply isn’t in the DOM yet.
In short:
- If the injected content is visible →
PDF works
- If the injected content hasn’t been added yet →
PDF can’t find it
If you’re injecting content asynchronously, you can wrap your PDF call in whatever callback or promise resolves after the injection is complete.
Thanks Ben.
You have been instrumental, along with HyperBytes, to me learning Wappler.