Jump to content



Photo

Save Image Inside Csv, Is Possible With Ubot?


  • Please log in to reply
5 replies to this topic

#1 XpownX

XpownX

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 196 posts
  • OS:Windows 8
  • Total Memory:8Gb
  • Framework:v4.0
  • License:Developer Edition

Posted 05 February 2019 - 06:27 AM

Hi

 

I need to create a bot that saves images( .jpg, size about 7kb ) inside a csv table. Is this possible with ubot studio, if yes how?

 

Thanks



#2 HelloInsomnia

HelloInsomnia

    Advanced Member

  • Moderators
  • 3070 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 05 February 2019 - 02:40 PM

I would store the path to the image, you could also do base64 but that would be a super long string. I've never seen an image in a CSV before, generally, you can open CSV files in a text editor.



#3 XpownX

XpownX

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 196 posts
  • OS:Windows 8
  • Total Memory:8Gb
  • Framework:v4.0
  • License:Developer Edition

Posted 06 February 2019 - 12:53 AM

I would store the path to the image, you could also do base64 but that would be a super long string. I've never seen an image in a CSV before, generally, you can open CSV files in a text editor.

 

But the main problem is that I need images in the CSV file because I need to print that



#4 HelloInsomnia

HelloInsomnia

    Advanced Member

  • Moderators
  • 3070 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 06 February 2019 - 01:08 PM

But the main problem is that I need images in the CSV file because I need to print that

 

I would probably try to make it into a PDF. Off the top of my head I think you could possibly build an HTML table which would be just like using a CSV format with the rows and columns, and then convert the HTML file to a PDF file and print it.



#5 XpownX

XpownX

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 196 posts
  • OS:Windows 8
  • Total Memory:8Gb
  • Framework:v4.0
  • License:Developer Edition

Posted 06 February 2019 - 04:44 PM

I would probably try to make it into a PDF. Off the top of my head I think you could possibly build an HTML table which would be just like using a CSV format with the rows and columns, and then convert the HTML file to a PDF file and print it.

 

With which ubot studio command I can create HTML and convert it into PDF?

I like your solution!



#6 HelloInsomnia

HelloInsomnia

    Advanced Member

  • Moderators
  • 3070 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 07 February 2019 - 11:12 AM

With which ubot studio command I can create HTML and convert it into PDF?

I like your solution!

 

You can use the $html from table function to convert a table to html, but you will have to do something about the images. You could maybe replace them with a regular expression that looks for a url or file path and then puts that in an image tag. Or maybe make your own table to html converter which may be the way to go.

 

Then just find some conversion site like this one: https://html2pdf.com/






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users