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

Bitmap annotation not added in PDF.

More
IP: 192.168.0.71 11 years 3 months ago #8007 by moontech
We can't send complete project.
We are using below code for graphic annotation:

public void graphicannotation(Bitmap bitmap)
{
m_doc.SetCache(Global.tmp_path + "/temp.dat");
int c_page = Constant.currentpage;
pa = m_doc.GetPage(c_page);
pa.ObjsStart();
PDFVPage vpage = m_rPDF.m_view.vGetPage(c_page);
float[] rect = { 200, 200, (200 + bitmap.getWidth()),
(200 + bitmap.getHeight()) };
pa.AddAnnotBitmap(bitmap, true, rect);
float m_ratio = ((float) m_doc.GetPageHeight(c_page))
/ ((float) m_doc.GetPageWidth(c_page));
Matrix mat = new Matrix(m_ratio, -m_ratio, 0,
m_doc.GetPageHeight(c_page) * m_ratio);

pa.RenderToBmp(bitmap, mat);
m_rPDF.m_view.vRenderSync(vpage);
pa.Close();
mat.Destroy();
bitmap.recycle();
}


To save pdf:

m_rPDF.PDFEndAnnot();
savedailog(); (here it updates file name)
boolean a = m_rPDF.PDFSave();

onResume() we are not using any object or method of this library.

Can you suggest anything form this?
More
IP: 192.168.0.71 11 years 3 months ago - 11 years 3 months ago #8009 by radaee
this line has problem:
m_doc.SetCache(Global.tmp_path + "/temp.dat");
it invoked every time when function "graphicannotation" call.
to be sure: only once of m_doc.SetCache method invoked.
Last edit: 11 years 3 months ago by .
More
IP: 192.168.0.71 11 years 3 months ago #8017 by moontech
It added by mistake. We are not using it every time. Invoking only once after m_doc.Open().
More
IP: 192.168.0.71 11 years 3 months ago #8018 by radaee
the simplest debug is:
set debug point in Document.SetCache();
and check it invoked times.
More
IP: 192.168.0.71 11 years 3 months ago #8024 by moontech
Yes, we have checked that. It invoked only once.
More
IP: 192.168.0.71 11 years 3 months ago #8028 by radaee
i have no more ideas, we tested demo project many times, and no problems found.
Time to create page: 0.384 seconds
Powered by Kunena Forum