Print Page | Close Window

Change ImageResolution

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2593
Printed Date: 26 Nov 24 at 8:54AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Change ImageResolution
Posted By: Karsten
Subject: Change ImageResolution
Date Posted: 08 Apr 13 at 8:36AM
Hi,

I must reduce the filesize of my PDFs and save as new one.
How can I change the imageresolution of alle images to 72 dpi wit QuickPDFLibrary?

This code don't do this

private static void resizePDF(string source, string target)
        {
            PDFLibrary QP = new PDFLibrary(@"QuickPDFDLL0816.dll");
            string licenseKey = "...licensekey...";
            QP.UnlockKey(licenseKey);

            int FileHandle = QP.LoadFromFile(source, "");
            int numPages = QP.PageCount();
            int numImages = QP.FindImages();
            for (int i = 1; i <= numPages; i++)
            {
                for (int j = 1; j <= numImages; j++)
                {
                    int idxImage = QP.GetImageID(i);
                    QP.SelectImage(idxImage);
                    QP.SetImageResolution(72,72,2);
                }
            }

            QP.SaveToFile(target);
        }


Regards
Karsten



Replies:
Posted By: Ingo
Date Posted: 08 Apr 13 at 10:05AM
Hi Karsten!
 
Changing directly inside a created pdf won't succeed with QP.
For my opinion you have to extract all content... then resize
the images and then reassamble the pages.
If you have luck the new result looks similar to the old one ;-)
Sorry.
 
Cheers, Ingo
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk