I am drawing to PdfDocument.Canvas. Lines, text, rectangles, all rendering fine, producing an incredible PDF document.
I go to add some DrawBitmap, and now AcrobatReader can no longer open the PDF. His error reported is "There was an error opening this document. The file is damaged and could not be repaired." I tried making the source rectangle NULL, but this did not help. Remove ALL calls to DrawBitmap and it produces a PDF file which Acrobat can open just fine.
My bitmap rendering routine is:
Note: the "drw" object is the Canvas property from my PdfDocument.Canvas property. I have been using drw in this way for lines, text, and rectangles.
PdfDocument defined by "Printing (version: 1.00)" library I obtained through B4A posts here.
I go to add some DrawBitmap, and now AcrobatReader can no longer open the PDF. His error reported is "There was an error opening this document. The file is damaged and could not be repaired." I tried making the source rectangle NULL, but this did not help. Remove ALL calls to DrawBitmap and it produces a PDF file which Acrobat can open just fine.
My bitmap rendering routine is:
B4X:
Public Sub DrawImage( bm As Bitmap, hpos As Float, vpos As Float)
Dim src As Rect
Dim dst As Rect
src.Initialize(0,0,bm.Width,bm.Height)
dst.Initialize(Orx+(hpos*72),Ory+(vpos*72),Orx+(hpos*72)+bm.Width,Ory+(vpos*72)+bm.Height)
drw.DrawBitmap(bm,Null,dst)
End Sub
Note: the "drw" object is the Canvas property from my PdfDocument.Canvas property. I have been using drw in this way for lines, text, and rectangles.
PdfDocument defined by "Printing (version: 1.00)" library I obtained through B4A posts here.