Hi, need some advice on the following problem:
I wanted to create a pdf from a table that wasn't produced using a database. Erel suggested I look at the DBUtils and borrow some code from the ExecuteHTML sub. In the attached, I have been able to generate an HTML table from my table data and open a WebView with the table data showing; so far, so good. The problem is then creating a BitMap from the WebView - the WebView.CaptureBitmap returns a NULLPOINTER exception. Other posts suggested the format might be:
and I've also seen
but both cause the NULLPOINTER problem. I also tried to initialize the image bitmap with a bitmap file and the replacing it with CaptureBitMap approach but that didn't work either.
if the Bitmap is initialised with an image file, the pdfwriter part of the code successfully saves the image as a pdf so the problem appears to lie somewhere around line 158 with the WebView1.CaptureBitMap code. Would be grateful for any suggestions. Thanks.
I wanted to create a pdf from a table that wasn't produced using a database. Erel suggested I look at the DBUtils and borrow some code from the ExecuteHTML sub. In the attached, I have been able to generate an HTML table from my table data and open a WebView with the table data showing; so far, so good. The problem is then creating a BitMap from the WebView - the WebView.CaptureBitmap returns a NULLPOINTER exception. Other posts suggested the format might be:
B4X:
dim img as BitMap
img.initialize3(WebView1.CaptureBitMap)
and I've also seen
B4X:
img=WebView1.CaptureBitMap
but both cause the NULLPOINTER problem. I also tried to initialize the image bitmap with a bitmap file and the replacing it with CaptureBitMap approach but that didn't work either.
if the Bitmap is initialised with an image file, the pdfwriter part of the code successfully saves the image as a pdf so the problem appears to lie somewhere around line 158 with the WebView1.CaptureBitMap code. Would be grateful for any suggestions. Thanks.
Attachments
Last edited: