logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
rodrich Posted: Tuesday, July 31, 2018 5:54:08 AM(UTC)
 
Thanks! I had solved it another way that let me save it cropped as I rendered the pages. But I definately appreciate this code. I can use it too.

Thanks again!
Paul Rayman Posted: Monday, July 30, 2018 6:35:22 PM(UTC)
 
You may use standard .Net image to crop already rendererd pages.

Code:
            using (var originalImage = Image.FromFile(@"d:\0\9\page01.PNG"))
            {
                var rectangleForCrop = new Rectangle(50, 50, 350, 350);
                using (var croppedImage = new Bitmap(rectangleForCrop.Width, rectangleForCrop.Height))
                {
                    using (var g = Graphics.FromImage(croppedImage))
                    {
                        g.DrawImageUnscaledAndClipped(originalImage, rectangleForCrop);
                    }
                    croppedImage.Save(@"d:\0\9\page01_cropped.png", ImageFormat.Png);
                }
            }


Or you can render the desired page area to an image of any size.
An example of similar task may be found here
https://forum.patagames....functionality-as-Acrobat
rodrich Posted: Monday, July 30, 2018 8:18:59 AM(UTC)
 
I have no problems saving a pdf document to a series of imgages of the full page, but don't have any idea how to apply a crop to all pages and save the pages as images. Any examples you can offer would be helpful. I am using the trial version so if it can't be done in that, please let me know. Thanks for any help you can provide!