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

Notification

Icon
Error

New Topic Post Reply
Options
Go to last post Go to first unread
rodrich  
#1 Posted : Monday, July 30, 2018 8:18:59 AM(UTC)
Quote
rodrich

Rank: Newbie

Groups: Registered
Joined: 7/30/2018(UTC)
Posts: 2
United States
Location: Panama City, Florida

Thanks: 1 times
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!
Paul Rayman  
#2 Posted : Monday, July 30, 2018 6:35:22 PM(UTC)
Quote
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
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

Edited by user Monday, July 30, 2018 6:38:38 PM(UTC)  | Reason: Not specified

thanks 1 user thanked Paul Rayman for this useful post.
rodrich on 7/31/2018(UTC)
rodrich  
#3 Posted : Tuesday, July 31, 2018 5:54:08 AM(UTC)
Quote
rodrich

Rank: Newbie

Groups: Registered
Joined: 7/30/2018(UTC)
Posts: 2
United States
Location: Panama City, Florida

Thanks: 1 times
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!
Quick Reply Show Quick Reply
Users browsing this topic
Guest
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.