- Posts: 37
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Display Bitmap and Drawable contents on the pages
11 years 1 month ago - 11 years 1 month ago #9664
by jorisk
Replied by jorisk on topic Display Bitmap and Drawable contents on the pages
Multimedia annotations is exactly what I need, but I don't get how AddAnnotBitmap is working.
Last edit: 11 years 1 month ago by jorisk.
11 years 1 month ago #9667
by Davide
Replied by Davide on topic Display Bitmap and Drawable contents on the pages
Hi,
please check this : www.radaeepdf.com/documentation/javadocs....html#AddAnnotBitmap (Bitmap, boolean, float[])
please check this : www.radaeepdf.com/documentation/javadocs....html#AddAnnotBitmap (Bitmap, boolean, float[])
11 years 1 month ago - 11 years 1 month ago #9675
by jorisk
Replied by jorisk on topic Display Bitmap and Drawable contents on the pages
Thank you Davide but I already used this method according to the PDFSetStamp() method but it doesn't display the bitmap, only the rect zone.
EDIT
I get the Bitmap to be displayed, but I now need it to be on a specific position and it has to follow the page when we scroll to the next/previous page. Any idea? Here is my code updated.
Code:
In PDFReader.java, in a custom function:
if (bitmap != null) {
int len = m_rect.length;
PDFVPageSet pset = new PDFVPageSet(len);
PDFPos pos = m_view.vGetPos((int) m_rect[0], (int) m_rect[1]);
PDFVPage vpage = m_view.vGetPage(pos.pageno);
Matrix mat = new Matrix(m_rect[0], m_rect[1], m_rect[2], m_rect[3]);
mat.TransformRect(m_rect);
m_page.AddAnnotBitmap(bitmap, true, m_rect);
mat.Destroy();
pset.Insert(vpage);
if(m_listener!=null) {
m_listener.OnPageModified(vpage.GetPageNo());
}
m_status=STA_NORMAL;
m_rects=null;
}
In PDFReaderAct.java, in the OnPageChanged(int pageno) method:
invalidate();
m_view.vRenderAsync(m_vpage);
EDIT
I get the Bitmap to be displayed, but I now need it to be on a specific position and it has to follow the page when we scroll to the next/previous page. Any idea? Here is my code updated.
Code:
if (bitmap != null) {
int len = m_rect.length;
PDFVPageSet pset = new PDFVPageSet(len);
PDFVPage vpage = m_view.vGetPage(pageno);
Matrix mat = vpage.CreateInvertMatrix(m_view.vGetX(), m_view.vGetY());
mat.TransformRect(m_rect);
m_page.AddAnnotBitmap(bitmap, true, m_rect);
mat.Destroy();
pset.Insert(vpage);
if(m_listener!=null) {
m_listener.OnPageModified(vpage.GetPageNo());
}
m_status=STA_NORMAL;
m_rects=null;
}
Last edit: 11 years 1 month ago by jorisk.
11 years 1 month ago #9681
by Davide
Replied by Davide on topic Display Bitmap and Drawable contents on the pages
Hi,
can you please better explain your needs?
It seems that you are trying to simulate a sort of "FloatingButton" with addAnnot, isn't it?
can you please better explain your needs?
It seems that you are trying to simulate a sort of "FloatingButton" with addAnnot, isn't it?
11 years 1 month ago #9682
by jorisk
Replied by jorisk on topic Display Bitmap and Drawable contents on the pages
Hi Davide,
I would like to produce the same behaviour that I have with the method AddAnnotURI, which works perfectly: when you add an annotation URI to coordinates, they are drawn on the page, so when you change the page, the annotation URI stays on it.
When you try this with AddAnnotBitmap, the bitmap is drawn but it is not moving when you change the page.
I would like to produce the same behaviour that I have with the method AddAnnotURI, which works perfectly: when you add an annotation URI to coordinates, they are drawn on the page, so when you change the page, the annotation URI stays on it.
When you try this with AddAnnotBitmap, the bitmap is drawn but it is not moving when you change the page.
11 years 1 month ago #9683
by Davide
Replied by Davide on topic Display Bitmap and Drawable contents on the pages
Hi,
all the annots are related to the page, so if you want to display the same annot in all the pages, you simply have to recall AddAnnotBitmap in each page.
all the annots are related to the page, so if you want to display the same annot in all the pages, you simply have to recall AddAnnotBitmap in each page.
Time to create page: 0.340 seconds