Copy weblistbox to PDF

Hi All

I have a listbox on a webpage which is populated and I’m looking to create a copy of it to pdf as a web file.

I can ‘draw’ the listbox line by line and populate the results from the weblistbox content but that seems a looooonnnnggg way round. Looking at the docs I can see pdflistbox which is ‘a standard listbox that can be embedded into a pdf document.’ which to me suggests it can just be copied … somehow ! but cant figure out how.

Any pointers or examples would be welcome

Thanks

Grant

Have-you downloaded the Xojo Examples (from the IDE) ?

Hi

Thanks for the response , unfortunately I cant find anything with pdflistbox or copying a weblist box in the examples.

thanks
Grant

In my MBS seminar on REST PDF I converted a WebListBox to HTML then converted that to a PDF using wkHTML2PDF. The link to the code is: https://www.holymackerelsoftware.com/Downloads/ExportHTMLToPDF.zip

you must look at the pdftable class, make your listbox (which must be a subclass of the xojo listbox) have the class interface PDFTableDataSource, to send the data to the pdfdocument you create using the pdfdocument.addtable method.

https://documentation.xojo.com/api/pdf/pdftable.html#pdftable

Hi David

thanks for the response , it looks as if the code required MBS plugins which I haven’t got.

Thanks anyway

Grant

Hi Jean

Thanks for the response I’m not sure my skills are up to your suggestion without so further expansion if your willing.

Thanks

Grant

here is an explaination how to do it

Hi Jean

That looks perfect, I will study with great interest.