[Client-side HTML to PDF] getting pdfCreator is not defined error while using ClientSideHtmltoPdf

Forge Component
(1)
Published on 31 Mar by Kilian Hekhuis
1 vote
Published on 31 Mar by Kilian Hekhuis

Hi, 

I am trying to download html page as a pdf, for that I am using ClientSideHtmltoPdf. Getting pdfCreator is not defined error while using  ClientSideHtmltoPdf.

Neha Bhosale wrote:

Hi, 

I am trying to download html page as a pdf, for that I am using ClientSideHtmltoPdf. Getting pdfCreator is not defined error while using  ClientSideHtmltoPdf.

Hello, 

Did you generate the app after installing that component? 


Hi Neha,

Appologies for the late reply. That error indicates that you didn't include the PdfGenerator Web Block on the Screen you call GeneratePdf.

Hi Kilian,

thank for your answer, but how do I get the PdfGenerator Web Block on the screen ? Pulling is not possible.

Tobias

Hi Kilian,

I am now one step further. I've done the PdfGenerator Web Block on the Screen you call GeneratePdf.

But i get a new error "Can't read property 'r' is undefined"

Could you help ?

Thanks.

Tobias.


Mmm, I've never seen that error. Did you try the escape that comes with the component? Does it work for you?

Hi Kilian,

sorry for the late reply, but my environment was in maintenance. Yes your example that comes with the component works fine.

I have four blocks, which are made dynamically visible via an expression (standard procedure for the Wizard widget). Only in the last block the error does not come and a PDF download is possible. The other blocks contain a form widget, ligtbox-widget and so on.  Maybe it has something to do with it ..

Tobias


an addition. I have installed an input widget in the example, there is the same error.

Tobias

Hi Tobias,

Can you post the OML of the example with the input widget here, so I can check what is going on?

Hi Kilian,

with pleasure. Thank you very much for your efforts.

Tobias

Hi Tobias,

Apologies for not getting back sooner. I have identified the problem (I think), but I cannot publish a new version because I'm having some problems with my PE. As soon as that's sorted out I'll publish a new version of the component.

Hi Kilian,

Great. I'm looking forward to it. I have now tested the other plugins. But they were all too complicated and i couldn't get them to work properly.

Especially now I wish you and your family a lot of health. 

Tobias


Well, it took a while (sorry for that!), but I've uploaded a new version that should fix your problem.

I also updated the description a bit, and it might be interesting for your test case: always put text in its own container, do not add other stuff to the same container.

Hi Kilian,

sorry for the long wait, but I was in quarantine.
First of all, thank you for your effort. I'm getting a little further. Unfortunately, the data entered in the input field is not visible (see also photos).

Tobias


Hi Tobias,

That's true, but there's nothing we can do about that, because that data is not part of the DOM.

EDIT: I think the best course of action is to switch to an Expression when pressing the PDF button. You can even style it as if it were an Input if that's what you'd want.

Hi Kilian,

thank you for the fast answer.

Could you please explain your suggestion a little bit, because I haven't really understood it yet. Sorry I'm not a real programmer. Maybe with a link to a plugin?

Tobias



Hi Tobias,

What I mean is that you put an If around the Input, and in one branch (say the True branch) you show the Input, and in the other branch an Expression that shows the input of the Input. The If is controlled by a Boolean Variable, let's call it ShowInput.

Then when the user clicks the button to save the PDF, before calling the Action to create the PDF, you set ShowInput to False, so the Expression shows, then you create the PDF (and if you need the Input afterwards, set ShowInput to True again).

Hi Team,

I am using this component in Reactive web app to directly print my web page to save as PDF.

Can you please help i am getting errror "pdfcreator is not defined"?

As my option is i dont want to provide URL to download i just want click and download the webpage being displayed.

Is there any other way to that for reactive web app.


Regards,
Ankit

Hi Ankit,

Please refer to this post in this same topic.

Kilian Hekhuis wrote:

Hi Ankit,

Please refer to this post in this same topic.

Hi Kilian ,

Thank you for your quick response but i am having the module in my app.

I am using REACTIVE WEB APP , but clientsidehtml is mobile module , So i crated by own pdftest module .

I want to download exact same webpage in REACTIVE WEB APP. Can you please help me for the same?


Regards,
Ankit


Hi Ankit,

It doesn't matter that it's a Mobile component, as Mobile should be usuable with Reactive. Also, like I wrote in the post I linked, you need to include the Block on your Screen, just adding a Reference is not enough (it never is, a Reference is just a link to something, not using something!).

Kilian Hekhuis wrote:

Hi Ankit,

It doesn't matter that it's a Mobile component, as Mobile should be usuable with Reactive. Also, like I wrote in the post I linked, you need to include the Block on your Screen, just adding a Reference is not enough (it never is, a Reference is just a link to something, not using something!).

Hi Kilian I am able to resolve that issue, It was related to scripts that was not getting loaded on start.

Thank you But there is another issue in content Please find my next comment


Ok, glad you could resolve it. If you have another question, please start a new topic in the subforum.