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")); } }
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; }