예제 #1
0
        private static void AddBorderStyleAlt(BorderStyleAltObject borderStyleAltObject, XmlElement annot, XmlDocument
                                              document)
        {
            //BorderStyle alt contains Border style encoded in the format specified in the border style attributes as content
            //has attributes
            XmlElement borderStyleAlt = document.CreateElement(XfdfConstants.BORDER_STYLE_ALT);

            //required attributes
            borderStyleAlt.SetAttribute(XfdfConstants.H_CORNER_RADIUS, XfdfObjectUtils.ConvertFloatToString(borderStyleAltObject
                                                                                                            .GetHCornerRadius()));
            borderStyleAlt.SetAttribute(XfdfConstants.V_CORNER_RADIUS, XfdfObjectUtils.ConvertFloatToString(borderStyleAltObject
                                                                                                            .GetVCornerRadius()));
            borderStyleAlt.SetAttribute(XfdfConstants.WIDTH_CAPITAL, XfdfObjectUtils.ConvertFloatToString(borderStyleAltObject
                                                                                                          .GetWidth()));
            //optional attribute
            if (borderStyleAltObject.GetDashPattern() != null)
            {
                //TODO add real conversion from PdfArray (PdfName.D in Border dictionary) to String
                borderStyleAlt.SetAttribute(XfdfConstants.DASH_PATTERN, JavaUtil.ArraysToString(borderStyleAltObject.GetDashPattern
                                                                                                    ()));
            }
            if (borderStyleAltObject.GetContent() != null)
            {
                borderStyleAlt.InnerText = borderStyleAltObject.GetContent();
            }
            annot.AppendChild(borderStyleAlt);
        }
예제 #2
0
        private static void AddFitV(FitObject fitVObject, XmlElement dest, XmlDocument document)
        {
            XmlElement fitV = document.CreateElement(XfdfConstants.FIT_V);

            //all required
            fitV.SetAttribute(XfdfConstants.PAGE_CAPITAL, fitVObject.GetPage().ToString());
            fitV.SetAttribute(XfdfConstants.LEFT, XfdfObjectUtils.ConvertFloatToString(fitVObject.GetLeft()));
            dest.AppendChild(fitV);
        }
예제 #3
0
        private static void AddFitR(FitObject fitRObject, XmlElement dest, XmlDocument document)
        {
            XmlElement fitR = document.CreateElement(XfdfConstants.FIT_R);

            //all required
            fitR.SetAttribute(XfdfConstants.PAGE_CAPITAL, fitRObject.GetPage().ToString());
            fitR.SetAttribute(XfdfConstants.LEFT, XfdfObjectUtils.ConvertFloatToString(fitRObject.GetLeft()));
            fitR.SetAttribute(XfdfConstants.BOTTOM, XfdfObjectUtils.ConvertFloatToString(fitRObject.GetBottom()));
            fitR.SetAttribute(XfdfConstants.RIGHT, XfdfObjectUtils.ConvertFloatToString(fitRObject.GetRight()));
            fitR.SetAttribute(XfdfConstants.TOP, XfdfObjectUtils.ConvertFloatToString(fitRObject.GetTop()));
            dest.AppendChild(fitR);
        }
예제 #4
0
        private static void AddXYZ(FitObject xyzObject, XmlElement dest, XmlDocument document)
        {
            XmlElement xyz = document.CreateElement(XfdfConstants.XYZ_CAPITAL);

            //all required
            xyz.SetAttribute(XfdfConstants.PAGE_CAPITAL, xyzObject.GetPage().ToString());
            xyz.SetAttribute(XfdfConstants.LEFT, XfdfObjectUtils.ConvertFloatToString(xyzObject.GetLeft()));
            xyz.SetAttribute(XfdfConstants.BOTTOM, XfdfObjectUtils.ConvertFloatToString(xyzObject.GetBottom()));
            xyz.SetAttribute(XfdfConstants.RIGHT, XfdfObjectUtils.ConvertFloatToString(xyzObject.GetRight()));
            xyz.SetAttribute(XfdfConstants.TOP, XfdfObjectUtils.ConvertFloatToString(xyzObject.GetTop()));
            dest.AppendChild(xyz);
        }