- Posts: 9
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Submit your requests and polls about new features
Annotations
- ricardo.cadete
- Topic Author
- Offline
- New Member
-
Less
More
IP: 192.168.0.70
13 years 3 months ago #731
by ricardo.cadete
Replied by ricardo.cadete on topic Annotations
Hi again,
I am going to need some help here. I could not found a example to explain how to use this new method: AddAnnotEditbox()
So imagine that I want to place a text in coordinates (100px, 80px) of PDF file.
How should I use this method?
page.AddAnnotEditbox(matrix, rect, tsize, 0x00FF0000);
-matrix -> should I worry about this?
-rect - > "left, top, right, bottom in DIB coordinate system." this seems to be easy if DIB means px of PDF file.
-tsize ->"test size in DIB coordinate system" test? What this means?
-color -> this is clear for me
What DIB means?
How should I know the size of the box If this is going to depend on the font to be applied on this box?
How should I apply the font?
Best regards
I am going to need some help here. I could not found a example to explain how to use this new method: AddAnnotEditbox()
So imagine that I want to place a text in coordinates (100px, 80px) of PDF file.
How should I use this method?
page.AddAnnotEditbox(matrix, rect, tsize, 0x00FF0000);
-matrix -> should I worry about this?
-rect - > "left, top, right, bottom in DIB coordinate system." this seems to be easy if DIB means px of PDF file.
-tsize ->"test size in DIB coordinate system" test? What this means?
-color -> this is clear for me
What DIB means?
How should I know the size of the box If this is going to depend on the font to be applied on this box?
How should I apply the font?
Best regards
IP: 192.168.0.70
13 years 3 months ago - 13 years 3 months ago #732
by radaee
Replied by radaee on topic Annotations
matrix -- the matrix passed to render function.
rect -- rect in DIB object.
tsize -- text size(sorry)
DIB means the bitmap that you had render out.
the font set by Global.setTextFont in Global.Init()
after you invoke this, page no any change,
because the edit box has no border and background.
rect -- rect in DIB object.
tsize -- text size(sorry)
DIB means the bitmap that you had render out.
the font set by Global.setTextFont in Global.Init()
after you invoke this, page no any change,
because the edit box has no border and background.
Last edit: 13 years 3 months ago by .
- ricardo.cadete
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
IP: 192.168.0.70
13 years 3 months ago - 13 years 3 months ago #750
by ricardo.cadete
Replied by ricardo.cadete on topic Annotations
Thank you,
do you think possible to have a example where explains how to place a text in coordinates (100px, 80px)?
do you think possible to have a example where explains how to place a text in coordinates (100px, 80px)?
Last edit: 13 years 3 months ago by cruzexx.
IP: 192.168.0.70
13 years 3 months ago - 13 years 3 months ago #755
by radaee
Replied by radaee on topic Annotations
sorry, we write Matrix as int, this is wrong.
we will fix it in next version.
to add edit box you need codes like this:
we will fix it in next version.
to add edit box you need codes like this:
Code:
bitmap.eraseColor(0xFFFFFFFF);
Page page = m_doc.GetPage(pageno);
if( page != null )
{
Matrix mat = new Matrix(m_ratio, -m_ratio, 0, m_doc.GetPageHeight(0) * m_ratio);
page.RenderToBmp(bitmap, mat);
float rect[] = new float[4];
rect[0] = 100;
rect[1] = 80;
rect[2] = rect[0] + 100;
rect[3] = rect[1] + 20;
page.AddAnnotEditbox(mat, rect, 18, 0);
mat.Destroy();
page.Close();
m_doc.Save();
}
Last edit: 13 years 3 months ago by .
- erikatomanderson
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
IP: 192.168.0.70
12 years 10 months ago #1994
by erikatomanderson
Replied by erikatomanderson on topic Annotations
Hello, I am trying to test out the free text annotations in the demo app. I'm afraid I don't know where to get the bitmap to use. Do I need to create a bitmap and addAnnotBitmap to the page? Or is there another bitmap that I would use and clear? Thanks for your help.
IP: 192.168.0.70
12 years 10 months ago #1995
by radaee
Replied by radaee on topic Annotations
no need to create Bitmap object to add FreeText annotation, like this:
Code:
bitmap.eraseColor(0xFFFFFFFF);
Page page = m_doc.GetPage(pageno);
if( page != null )
{
Matrix mat = new Matrix(m_ratio, -m_ratio, 0, m_doc.GetPageHeight(0) * m_ratio);
page.ObjsStart(bitmap, mat);
float rect[] = new float[4];
rect[0] = 100;
rect[1] = 80;
rect[2] = rect[0] + 100;
rect[3] = rect[1] + 20;
page.AddAnnotEditbox(mat, rect, 18, 0);
mat.Destroy();
page.Close();
m_doc.Save();
}
Time to create page: 0.398 seconds