Class for defines that are used when a pdf image is read.
Inheritance: DefineCreator, IReadDefines
Example #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);
        }
    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"));
      }
    }
Example #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;
 }