Loading...

annotation pdf scheme 8.2

Support for GdPicturePDF Plugin.

annotation pdf scheme 8.2

Postby lauberth » Tue Oct 04, 2011 1:42 pm

hi,
i have tried to add stickynoteannotation like you mentioned. if i open the resulting pdf in adobe reader the comments are shown in the list of comments but the correspondig icon is anywhere after the page
if open it again in the gdviewer i do have the objects but they are not visible.
any suggestions or a hint about the correct usage.

rgds
Thomas
lauberth
 
Posts: 9
Joined: Thu Oct 08, 2009 8:52 am

Re: annotation pdf scheme 8.2

Postby Loïc » Wed Oct 05, 2011 2:45 pm

Hi Thomas,

Could you provide more information of what you are expecting ?
Also, could you provide a snippet ?

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: annotation pdf scheme 8.2

Postby lauberth » Thu Oct 06, 2011 2:07 pm

hi,

i tried following task
i used the annotation demo
i added a Mousup Event to the gdviewer1 component

following code tries to add a lineannotation to the loaded pdf
after saving the pdf the annotation is added but the line is not at the right position in the pdf.

Do i have a wrong idea of how it should work?

i want have the marker in the pdf and on mouseover or click i want to see the annotationtext.




Code: Select all
// check a rectangle has been drawn
            if (GdViewer1.IsRect())
            {
                int t_left = 0;
                int t_top = 0;
                int t_width = 0;
                int t_height = 0;

                // get the co-ordinates / size of the drawn area
                GdViewer1.GetRectCoordinatesOnDocument(ref t_left, ref t_top, ref t_width, ref t_height);
                int regionID = GdViewer1.AddRegion("myRegion'", t_left, t_top + t_height, t_width, 3, ForegroundMixMode.ForegroundMixModeMASKPEN, GdViewer1.ARGB(0,0,255,255));

                float n_left = GdViewer1.GetRegionLeft(regionID);
                float n_top = GdViewer1.GetRegionTop(regionID);
                float n_width = GdViewer1.GetRegionWidth(regionID);
                float n_height = GdViewer1.GetRegionHeight(regionID);

                pdf.AddLineAnnotation(n_left,
                    n_top,
                    n_left + n_width,
                    n_top + n_height,
                    "Comment",
                    "myFirstComment",
                    PdfAnnotationLineEndingStyle.PdfAnnotationLineEndingStyleOpenArrow,
                    PdfAnnotationLineEndingStyle.PdfAnnotationLineEndingStyleClosedArrow,
                    false,
                    n_width,
                    PdfAnnotationBorderStyle.PdfAnnotationBorderStyleUnderline,
                    0,
                    0,
                    1,
                    255, 0, 0);
lauberth
 
Posts: 9
Joined: Thu Oct 08, 2009 8:52 am

Re: annotation pdf scheme 8.2

Postby Loïc » Thu Oct 06, 2011 2:16 pm

Hi,

I think you have a coordinates space issue.

Could you try this ? (not tested form my side, I have to go).

Code: Select all
// check a rectangle has been drawn
            if (GdViewer1.IsRect())
            {
                float t_left = 0;
                float t_top = 0;
                float t_width = 0;
                float t_height = 0;

                // get the co-ordinates / size of the drawn area
                GdViewer1.GetRectCoordinatesOnDocumentInches(ref t_left, ref t_top, ref t_width, ref t_height);

                pdf.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitInch);
                pdf.AddLineAnnotation(n_left,
                    n_top,
                    n_left + n_width,
                    n_top + n_height,
                    "Comment",
                    "myFirstComment",
                    PdfAnnotationLineEndingStyle.PdfAnnotationLineEndingStyleOpenArrow,
                    PdfAnnotationLineEndingStyle.PdfAnnotationLineEndingStyleClosedArrow,
                    false,
                    n_width,
                    PdfAnnotationBorderStyle.PdfAnnotationBorderStyleUnderline,
                    0,
                    0,
                    1,
                    255, 0, 0);


Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: annotation pdf scheme 8.2

Postby lauberth » Thu Oct 06, 2011 5:31 pm

tried this but it does not work
the start and endcaps are always very large and the width is not working
it seems the i have not unterstood how the coordinates beetween viewer and document are working


i just want mark with areaselection an area where i want to mark for annotation

rgds
thomas
lauberth
 
Posts: 9
Joined: Thu Oct 08, 2009 8:52 am

Re: annotation pdf scheme 8.2

Postby Loïc » Thu Oct 06, 2011 5:56 pm

Hi,

Well I finally tried. Here a snippet that should work:




Code: Select all
// check a rectangle has been drawn
            if (GdViewer1.IsRect())
            {
                float t_left = 0;
                float t_top = 0;
                float t_width = 0;
                float t_height = 0;

                // get the co-ordinates / size of the drawn area
                GdViewer1.GetRectCoordinatesOnDocumentInches(ref t_left, ref t_top, ref t_width, ref t_height);

                pdf.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitInch);
                pdf.SetOrigin(PdfOrigin.PdfOriginTopLeft);
                      m_pdf.AddLineAnnotation(l, t, l + w, t + h, "titre", "content", PdfAnnotationLineEndingStyle.PdfAnnotationLineEndingStyleCircle, PdfAnnotationLineEndingStyle.PdfAnnotationLineEndingStyleCircle, True, 0.01, PdfAnnotationBorderStyle.PdfAnnotationBorderStyleSolid, 0, 0, 1, 255, 0, 0);


Note: you had to define the Origin coordinate. By default in PDF it is bottom-left when in GdPicture Image it is top-left ;)
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: annotation pdf scheme 8.2

Postby lauberth » Fri Oct 07, 2011 12:38 pm

hi loic,

finally it is now working.
if i view the resulting pdf in adobe reader or foxit the circles are shown.

if i open it in gdViewer just the line without the circles is shown.
any ideas

rgds
Thomas
lauberth
 
Posts: 9
Joined: Thu Oct 08, 2009 8:52 am

Re: annotation pdf scheme 8.2

Postby Loïc » Mon Oct 10, 2011 2:50 pm

Hi,

if i open it in gdViewer just the line without the circles is shown.
any ideas


Working fine for me, could you attach the PDF ? If it is private, you can upload it through http://support.gdpicture.com

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: annotation pdf scheme 8.4

Postby lauberth » Wed Nov 09, 2011 4:53 pm

i have downloaded the latest version 8.4
i did a change on the annotation example as i added a function (followint code)

private void tsAnnotation_Click(object sender, EventArgs e)
{
// check a rectangle has been drawn
if (GdViewer1.IsRect())
{
float t_left = 0;
float t_top = 0;
float t_width = 0;
float t_height = 0;

// get the co-ordinates / size of the drawn area
GdViewer1.GetRectCoordinatesOnDocumentInches(ref t_left, ref t_top, ref t_width, ref t_height);

pdf.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitInch);
pdf.SetOrigin(PdfOrigin.PdfOriginTopLeft);

int annot = pdf.AddLineAnnotation(
t_left,
t_top + t_height,
t_left + t_width,
t_top + t_height,
"mein Kommentar",
"mein erster Kommentar",
PdfAnnotationLineEndingStyle.PdfAnnotationLineEndingStyleCircle,
PdfAnnotationLineEndingStyle.PdfAnnotationLineEndingStyleCircle,
false,
1 / 100,
PdfAnnotationBorderStyle.PdfAnnotationBorderStyleSolid,
0,
0,
1,
255,
0,
0);
GdViewer1.Redraw();
MessageBox.Show(string.Format("annot nr: {0}; anz: {1}", annot, pdf.GetAnnotationCount()));
}

this code is working as it adds an annotation with text and a line without circles.

i save the file in a new pdf and view it with adobe reader, foxit reader where i can see the line and the circles.
if i view it wth gdviewer1.displayfromGDPicturePdf(pdf) i see only the line without the circles.

Another question is: how can i select the annotation within the gdviewer as AnnontationSelected ist not fired. Do i have to check it by myself with mousemove events checking against the properties of the annotations (rectangles)

i tried to Attach the pdf which is not working.

btw. if i view the pdf in foxit and save it again / the circles are shown in gdviewer on reviewing the pdf

rgds
Thomas
lauberth
 
Posts: 9
Joined: Thu Oct 08, 2009 8:52 am

Re: annotation pdf scheme 8.2

Postby Loïc » Wed Nov 09, 2011 7:29 pm

Hi Thomas,

Can you send the produced PDF via http://support.gdpicture.com

We should fix this problem in no time.

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: annotation pdf scheme 8.2

Postby lauberth » Fri Nov 11, 2011 11:50 am

Hi got it running. Sorry was my fault.
wrong sizing of line_width.

As i mentioned i would like to have an option to view the comments on mousover or anything else.
if you have any ideas let me know.

rgds
thomas
lauberth
 
Posts: 9
Joined: Thu Oct 08, 2009 8:52 am


Return to GdPicture PDF Plugin

Who is online

Users browsing this forum: No registered users and 1 guest