コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
0
        /// <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);
        }