Beispiel #1
0
        private void ReadProperties()
        {
            readPropertyByName <string>(AnnotationConsts.SUBTYPE, false);
            readPropertyByName <string>(AnnotationConsts.TITLE, false);
            readPropertyByName <string>(AnnotationConsts.CONTENTS, false);
            readPropertyByName <double>(AnnotationConsts.WIDTH, true);
            readPropertyByName <Datalogics.PDFL.Color>(AnnotationConsts.COLOR, false);
            readPropertyByName <Datalogics.PDFL.Color>(AnnotationConsts.INTERIOR_COLOR, false);
            readPropertyByName <Datalogics.PDFL.Color>(AnnotationConsts.TEXT_COLOR, false);
            readPropertyByName <string>(AnnotationConsts.FONT_FACE, false);
            readPropertyByName <double>(AnnotationConsts.FONT_SIZE, false);
            readPropertyByName <IList <double> >(AnnotationConsts.DASH_PATTERN, false);
            readPropertyByName <Datalogics.PDFL.Rect>(AnnotationConsts.BOUNDING_RECT, true);
            readPropertyByName <string>(AnnotationConsts.STYLE, false);

            readPropertyByName <Datalogics.PDFL.Point>(AnnotationConsts.START_POINT, true);
            readPropertyByName <Datalogics.PDFL.Point>(AnnotationConsts.END_POINT, true);
            readPropertyByName <IList <Datalogics.PDFL.Point> >(AnnotationConsts.VERTICES, true);
            readPropertyByName <Datalogics.PDFL.HorizontalAlignment>(AnnotationConsts.QUADDING, false);

            readPropertyByName <Datalogics.PDFL.LineEndingStyle>(AnnotationConsts.START_ENDING_STYLE, false);
            readPropertyByName <Datalogics.PDFL.LineEndingStyle>(AnnotationConsts.END_ENDING_STYLE, false);
            readPropertyByName <IList <Datalogics.PDFL.Quad> >(AnnotationConsts.QUADS, true);

            normalAppearance = getPropertyByName <Datalogics.PDFL.Form>(AnnotationConsts.NORM_APPEARANCE);

            if (annotation is LinkAnnotation)
            {
                Datalogics.PDFL.Action action = (annotation as LinkAnnotation).Action;
                if (action is GoToAction)
                {
                    ActionData actionData = new ActionData(action as GoToAction);
                    properties.SetProperty <ActionData>(AnnotationConsts.ACTION, actionData, true);
                }
                SetShowBorderProperties();
            }
            else if (annotation is InkAnnotation)
            {
                ReadScribbles();
            }

            SetSupportedProperty(annotation);
            properties.Dirty = false;
        }
Beispiel #2
0
 private void WriteProperties()
 {
     foreach (string property in properties.Available)
     {
         if ((property == AnnotationConsts.SCRIBBLES) && (annotation is InkAnnotation))
         {
             WriteScribbles((IList <IList <Datalogics.PDFL.Point> >)properties[AnnotationConsts.SCRIBBLES].Value);
         }
         else if ((property == AnnotationConsts.ACTION) && (annotation is LinkAnnotation))
         {
             ActionData      actionData      = properties[property].Value as ActionData;
             ViewDestination viewDestination = new ViewDestination(document, actionData.pageNum, actionData.fitType, actionData.destRect, actionData.zoom);
             (annotation as LinkAnnotation).Action = new GoToAction(viewDestination);
         }
         else
         {
             setPropertyByName(property, properties[property].Key, properties[property].Value);
         }
     }
 }