/// <summary> /// Main method for running the sample. /// </summary> public static SampleOutputInfo[] Run(Stream input) { // Load the input file. PdfFixedDocument document = new PdfFixedDocument(input); PdfConvertToGrayTransform grayTransform = new PdfConvertToGrayTransform(); PdfPageTransformer pageTransformer = new PdfPageTransformer(document.Pages[3]); pageTransformer.ApplyTransform(grayTransform); SampleOutputInfo[] output = new SampleOutputInfo[] { new SampleOutputInfo(document, "xfinium.pdf.sample.grayscaleconversion.pdf") }; return(output); }
/// <summary> /// Main method for running the sample. /// </summary> public static SampleOutputInfo[] Run(Stream input) { // Load the input file. PdfFixedDocument document = new PdfFixedDocument(input); PdfReplaceImageTransform replaceImageTransform = new PdfReplaceImageTransform(); replaceImageTransform.ReplaceImage += new EventHandler<PdfReplaceImageEventArgs>(HandleReplaceImage); PdfPageTransformer pageTransformer = new PdfPageTransformer(document.Pages[2]); pageTransformer.ApplyTransform(replaceImageTransform); replaceImageTransform.ReplaceImage -= new EventHandler<PdfReplaceImageEventArgs>(HandleReplaceImage); SampleOutputInfo[] output = new SampleOutputInfo[] { new SampleOutputInfo(document, "xfinium.pdf.sample.removereplaceimages.pdf") }; return output; }
/// <summary> /// Main method for running the sample. /// </summary> public static SampleOutputInfo[] Run(Stream input) { // Load the input file. PdfFixedDocument document = new PdfFixedDocument(input); PdfReplaceImageTransform replaceImageTransform = new PdfReplaceImageTransform(); replaceImageTransform.ReplaceImage += new EventHandler <PdfReplaceImageEventArgs>(HandleReplaceImage); PdfPageTransformer pageTransformer = new PdfPageTransformer(document.Pages[2]); pageTransformer.ApplyTransform(replaceImageTransform); replaceImageTransform.ReplaceImage -= new EventHandler <PdfReplaceImageEventArgs>(HandleReplaceImage); SampleOutputInfo[] output = new SampleOutputInfo[] { new SampleOutputInfo(document, "xfinium.pdf.sample.removereplaceimages.pdf") }; return(output); }