send email

  

Hi,

 I have used the outsystems create a webpage with some charts in it? And I have used the get current page content action to fetch the contents of the page, then use the rich mail send to send them in the email.
But I couldn`t send the charts in the email. How to fix it? Thanks a lot.
Sending images/graphs via mail is always a problem as not all mail clients behave in the same way.
I think the best solution would be to add the graphs as attachment to the mails as a picture. 
That "low-level" way is something all mail clients support.
Hi,
Agreed with curt , additionaly you can convert your html to pdf (already availabel with platform) and than attach that pdf as single document in mail and send.

Regards,
-PJ-


Pramod Jain wrote:
Hi,
Agreed with curt , additionaly you can convert your html to pdf (already availabel with platform) and than attach that pdf as single document in mail and send.

Regards,
-PJ-

 
 Hi Pramod,

How can I convert my html to pdf? I didn`t find it on the platform, thank you.
 

eric wang wrote:
Pramod Jain wrote:
Hi,
Agreed with curt , additionaly you can convert your html to pdf (already availabel with platform) and than attach that pdf as single document in mail and send.

Regards,
-PJ-

 
 Hi Pramod,

How can I convert my html to pdf? I didn`t find it on the platform, thank you.
 
 
 Try this , available in forge.

https://www.outsystems.com/forge/component/209/html2pdfconverter/

Regards,
-PJ-
 
Pramod Jain wrote:
eric wang wrote:
Pramod Jain wrote:
Hi,
Agreed with curt , additionaly you can convert your html to pdf (already availabel with platform) and than attach that pdf as single document in mail and send.

Regards,
-PJ-

 
 Hi Pramod,

How can I convert my html to pdf? I didn`t find it on the platform, thank you.
 
 
 Try this , available in forge.

https://www.outsystems.com/forge/component/209/html2pdfconverter/

Regards,
-PJ-
 
 Thank you. I have used "URLtoPDF_Direct" action,  but still the charts can`t be displayed in the PDF file.
Does the "URLtoPDF_Extended" will solve this problem? But I don`t know how to set the extendedconfiguration data? Thank you.
 

Hi eric,
Does your charts are appering on the screen? Means have you seen the charts in html screen before convirting them to pdf?


Regards
-PJ-
Pramod Jain wrote:
Hi eric,
Does your charts are appering on the screen? Means have you seen the charts in html screen before convirting them to pdf?


Regards
-PJ-
Thanks a lot for the reply. Yes, the charts are showing on the screen, and I can see the html of the charts.
 

If it is possible can you share your url so taht i can try printing here to pdf?

Regards
-PJ-
I'm not sure the html2pdf component is very good at the SGL used for the charts. Have you tried to start the EXE locally, manually?
Be sure that you provide a complete URL of the page (including all parameters).  

Also note: Html2PDF will create a PDF snapshot of the URL provided, NOT necessarily what you see on your screen when the extension is executed.  That means any changes to the data shown on your page through an AJAX refresh, will likely not be part of the URL and therefore not rendered in the PDF.

To make it work, you will need to generate the screen you want converted to a pdf via the Prep (or throug a Submit type screen action).

Hope this helps.
Marco


Pramod Jain wrote:
Hi eric,
Does your charts are appering on the screen? Means have you seen the charts in html screen before convirting them to pdf?


Regards
-PJ-
 Thanks a lot for the reply.
 I have saved the url as HomePage.html, and attach it here.
There should be two pie charts here, but it seems I can`t see it when open the html file.
eric,

A quick glance at the HTML shows there's no chart data in it. Also, when opening the HTML there's tons of errors because of missing jquery and Highcharts.
Kilian Hekhuis wrote:
eric,

A quick glance at the HTML shows there's no chart data in it. Also, when opening the HTML there's tons of errors because of missing jquery and Highcharts.
 Hi Kilian,

But I did draw two pie charts by using the OutSystems interface on the webpage. And I have attached the pic here. I didn`t get why there is no chart data in html. Will you please give some suggestions on how to fix it.
Thank you.
 

Hi eric,

I checked again, and the data is actually there. However, the HTML references many other files, with an absolute path to somewhere presumably on your desktop. That's why it doesn't work. However, your initial question wasn't about saving a HTML file of the page, but converting it to PDF, right?
Kilian Hekhuis wrote:
Hi eric,

I checked again, and the data is actually there. However, the HTML references many other files, with an absolute path to somewhere presumably on your desktop. That's why it doesn't work. However, your initial question wasn't about saving a HTML file of the page, but converting it to PDF, right?
 Thank you. My initial question was send this page`s content in email. And I got the suggestion is to convert it
to PDF firstly, then send it in the attachment. But it seems not work. 
 

eric,

The html2pdf forge component uses wkhtmltopdf. You could first manually try to save a page with it, and see if that works. I've done the same in the past, and concluded it didn't quite work (chart lines were too fat), but perhaps you are lucky.
Kilian Hekhuis wrote:
eric,

The html2pdf forge component uses wkhtmltopdf. You could first manually try to save a page with it, and see if that works. I've done the same in the past, and concluded it didn't quite work (chart lines were too fat), but perhaps you are lucky.
 Hi Kilian,

Thank you. I`ve tried it in my side, but it`s not working. The pie charts are still blank.
 

Solution
eric,

That's too bad! In that case you're royally screwed :). As a last resort, you could try PhantomJS. If it works to create the right output manually, perhaps you can create an extension to interface with it.
Solution
Kilian Hekhuis wrote:
eric,

That's too bad! In that case you're royally screwed :). As a last resort, you could try PhantomJS. If it works to create the right output manually, perhaps you can create an extension to interface with it.
 Thanks a lot. It works!
 

That's great to hear. I've used it in the past for some tests, and it handles SVG much better than wkhtmltopdf. Unfortunately. as far as I'm aware, there's no Forge component for it, but I don't think it's too difficult to create.

I received an email of here after 20 seconds

@Vlad: What do you mean? What has this to do with the topic?

Thanks for the advice.

Gclub

good advice!

thanks



register goldenslot

Thanks a lot. It works!

gclub slot mobile

Hello,

I also need some charts made with HighCharts and some js to be rendered in pdf. After I discovered that Html2PdfConverter performs poorly when the page contains js, I switched to using PhantomJS. So I created a .NET extension with the help of 3rd party NReco.PhantomJS library.

For PhantomJS to run, I extracted its folder containing the exe, and added its directory to the system PATH attribute in Advanced System Settings.

When I try it on command prompt, it works. However, when I try it on OutSystems, it gives the following error:

Cannot execute PhantomJS: Cannot find PhantomJS executable: C:\Program Files\OutSystems\Platform Server\running\UygunsuzlukRaporu.01861261249\bin\phantomjs.exe

When I place the desired phamtomjs.exe and rasterize.js to that folder, it works. But the folder is cleaned at each platform publish.

I think I couldn't make my Extension look for new PATH values and it looks for the exe in the Module bin folder. This project doesn't provide an installer or a setting for Binaries Path. I guess I need to change something in my extensions .NET code? Could you help me with this issue?

Thanks a lot.

Hi Ozan,

Your question seems only slightly related to the original topic, which is also marked as "Solved" (which means nobody not originally involved in this topic will likely take a look at your post) and is a year old. In the future, please create a new topic.

That said, have you set the "Deploy Action" Property of phantomjs.exe in your extension to "Copy to Binaries Directory"? If not that explains why it is not deployed on Publish.

Kilian Hekhuis wrote:

Hi Ozan,

Your question seems only slightly related to the original topic, which is also marked as "Solved" (which means nobody not originally involved in this topic will likely take a look at your post) and is a year old. In the future, please create a new topic.

That said, have you set the "Deploy Action" Property of phantomjs.exe in your extension to "Copy to Binaries Directory"? If not that explains why it is not deployed on Publish.

Hi Kilian,

Thanks a lot for the response. I added the exe as a Resource to my extension, but I cannot see the Deploy Action option, where do I find it?

Double click it in the tree, and a tab appears on the left. There you can set it.

Oh, double click...

Thanks for the help. Now it deploys the exe to the bin2 folder, however it still looks for the resource in bin folder and the error continues. Any ideas?

Well, if it wants the bin folder, deploy it to the bin folder? Why bin2?

Thanks for bothering, Kilian.

Even if I carry it to the bin folder, apparently OutSystems cleans and rebuilds the bin folder upon publish, without including my exe (even though I set its Deploy Action to "Copy to Binaries Directory"). However, when I check bin2 after publish, I can see my exe there.

Is there any other way to force the platform to deploy my resource to bin? 

Mmm, that's weird, apparently OS sees the need to create a bin2 as "binaries directoy". Can you show the expanded tree view of the things you include in the Extension?

Oh, my bin2 is also full of other dlls and resources, however bin folder only includes five of them (the apps dlls).


And this is my Extension tree:

I verified at our own set-up, and the bin2 directory is indeed the standard deployment directory, not bin. In the Extensions we have, we reference external files without a path, and that works fine, so if you reference "phantomjs.exe" in your Extension without a path, I would expect it to work.

What do you mean without a path, like the envorinment variable PATH?

I put the exe at every directory level in my extension as below, but it is still not deployed to the bin folder of the app, but to bin2.

Hi Ozan,

I assume somewhere in your extension, you do something like a Process.Start("phantomjs.exe") (or use ProcessStartInfo). If you have included the path (something like @"bin\phantomjs") then you shouldn't. Just use the plain executable. The fact it is deployed to the bin2 folder is correct, it's what the Platform does. You can't put it in the bin folder, but why would you want that?

Now it works Kilian, thank you very much!

I'm using NReco.PhantomJS library and changed the ToolPath parameter.

public void MssConvertToPdf(string ssurl, string sspdfName) {

            var phantomJS = new PhantomJS();

            phantomJS.ToolPath = @"C:\PhantomJs\bin\phantomjs";

            phantomJS.Run(@"C:\PhantomJs\bin\phantomjs\rasterize3.js", new[] { ssurl, sspdfName });

Great you got it work Ozan! Happy coding :)