Hi, I am trying Html to PDF with the following code:
Export The Statement As A PDF
Wait Until Element Is Visible CSS:.customer-statements-report-container {soa_html}= Get Element Attribute CSS:.customer-statements-report-container outerHTML
Html To Pdf {soa_html} {CURDIR}{/}soa.pdf
Try this solution. You might need to tune the img width to match your page size. Tell me how it goes.
Screenshot locator=CSS:.customer-statements-report-container filename=statement.png
Html To Pdf <img src='statement.png' width='480'/> ${CURDIR}${/}soa.pdf
Hello Guys, Iām currently going thru first LVL training, trying to build āMarias helperā but while I get to PDF generation part I canāt see the created PDF, moreover Iām not able to poit-out the directorry where the PDF should be, what I notice in the log files is that output directorry for the PDF is different than the given as open from> code below:
KEYWORD RPA.PDF . Html To Pdf ${sales_results_html}, ${OUTPUT_DIR}${/}sales_results.pdf
15:26:15.826 INFO Writing output to file C:\Users\limpy\AppData\Local\robocorp\temp\4d65822107fcc4be\tmpckt5l_pm\sales_results.pdf
KEYWORD RPA.PDF . Open Pdf ${OUTPUT_DIR}${/}sales_results.pdf
15:25:49.421 FAIL FileNotFoundError: [Errno 2] No such file or directory: āC:\Users\limpy\AppData\Local\robocorp\temp\4d65822107fcc4be\tmprbm0zdf2\sales_results.pdfā
*** Keywords ***
ExportTableAsPDF
Wait Until Element Is Visible id:sales-results
${sales_results_html}= Get Element Attribute id:sales-results outerHTML
Html To Pdf ${sales_results_html} ${OUTPUT_DIR}${/}sales_results.pdf
*** Keywords ***
OpenCreatedPDF
Open Pdf ${OUTPUT_DIR}${/}sales_results.pdf
can You please explain or direct me, how & where should I point out where is the file robot should look for ? or what am I doing wrong that PDF doesnāt appear - Yes I have PDF installed on my PC
Can you please copy and paste in or attach your conda.yaml and robot.yaml? Based on your error it looks like the output directory in the robot.yaml is being set to the temp folder for this run.
Hi there! If it helps, hereās a tested working robot example of filling an HTML template and saving the output PDF in the ./output directory.
Please pay attention to how I run it with VSCode or rcc (rcc run -t "Unicode HTML To PDF") through my robot.yaml and preparing the env given the conda.yaml (ignore the commented sections).