Class for defines that are used when a pdf image is read.
Наследование: DefineCreator, IReadDefines
Пример #1
0
        private IDefines CreatePdfReadDefines(XmlElement element)
        {
            if (element == null)
            {
                return(null);
            }
            PdfReadDefines result = new PdfReadDefines();

            result.FitPage    = Variables.GetValue <MagickGeometry>(element, "fitPage");
            result.UseCropBox = Variables.GetValue <Nullable <Boolean> >(element, "useCropBox");
            result.UseTrimBox = Variables.GetValue <Nullable <Boolean> >(element, "useTrimBox");
            return(result);
        }
Пример #2
0
    public void Test_UseCropBox_UseTrimBox()
    {
      PdfReadDefines defines = new PdfReadDefines()
      {
        UseCropBox = true,
        UseTrimBox = false
      };

      using (MagickImage image = new MagickImage())
      {
        image.Settings.SetDefines(defines);

        Assert.AreEqual("True", image.Settings.GetDefine(MagickFormat.Pdf, "use-cropbox"));
        Assert.AreEqual("False", image.Settings.GetDefine(MagickFormat.Pdf, "use-trimbox"));
      }
    }
Пример #3
0
 private IDefines CreatePdfReadDefines(XmlElement element)
 {
   if (element == null)
     return null;
   PdfReadDefines result = new PdfReadDefines();
   result.FitPage = Variables.GetValue<MagickGeometry>(element, "fitPage");
   result.UseCropBox = Variables.GetValue<Nullable<Boolean>>(element, "useCropBox");
   result.UseTrimBox = Variables.GetValue<Nullable<Boolean>>(element, "useTrimBox");
   return result;
 }