How do I reduce the time taken to add background images to every page of large documents?
Please note that a user asked this question in the PDF XChange forum. They were creating a PDF file in excess of 300 pages. Each page contained a background image that covered the entire page, and they were using text structs to add string values. These factors meant that 300 calls to AddPage, AddImage, and DrawText were required, which meant the process took over two minutes. They wanted to know if there was a way to reduce the length of time required.
Yes, there are ways to reduce the time taken to add background images. It depends on the specifics of the case:
If the image is the same for all pages then it can be added one time and then placed into all pages. This will result in the decoding/encoding process taking place only once, instead of 300 times, and an image comparison will not be performed. (The pxclib40.dll compares each image added to documents and remove duplicates in order to save on file/disc space).
If the image is different for each page then reducing the size in pixels is an effective method to make conversion faster, although some quality will be lost. Additionally, vector images (or .emf/wmf) can be used instead of raster images in order to save on file size.
Please note that adding images to documents is the most time-consuming operation in document creation. This is because it is necessary for all images to be decoded and converted into a format that the PDF standard supports, especially in the case of raster images.
Cookies are necessary in order to enable you to move around the website and use its features, including making purchases through our online store.
We need cookies in order to determine the number of unique users who visit the site, and to provide certain features, such as the login functionality.
We do not use cookies for advertising purposes.
By clicking Accept (or continuing to use the site) you are agreeing to our use of these tools. Learn More
These cookies are necessary for the website to function and cannot be switched off in PDF-XChange systems.
They are usually only set in response to actions made by you that result in a request for services, such as setting your privacy preferences, logging in, or filling in forms.
You can change the settings in your browser to block or alert you about these cookies, but doing so will result in some parts of the site losing functionality.
These cookies do not store any personally identifiable information.
You can contact us by phone, email or our social media accounts — we are here to assist you.