Android Question How to split pdf page

Sofian

Member
I have list item on CustomListView. On short list thre no problem to create n show pdf. Problem is on long list, error to load pdf after create.
1:
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 1019880 bytes

I plan to split on image draw from clv.sv.ScrollViewInnerPanel.Snapshot , but don't know how to split it . For sample bmp.height from snapshot = 50000 how to split to 3 part and draw to 3 pdf pages

Snapshot code :

2:
Dim pdf As PdfDocument
pdf.Initialize
Dim bmp As B4XBitmap=CLVX.sv.ScrollViewInnerPanel.Snapshot
Dim setH As Double =(bmp.Height / bmp.Scale)
pdf.StartPage(350,setH)
Dim Rect1 As Rect
Rect1.Initialize(3dip, 2dip, bmp.Width,bmp.Height / bmp.Scale)
Rect1.Width = (bmp.Width / bmp.Scale)  * 0.85
Rect1.Height = (bmp.Height / bmp.Scale) * 0.90
pdf.Canvas.DrawBitmap(bmp, Null,Rect1)
pdf.FinishPage
 
Top