Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

How can I create a background color for a complete document page with Quick PDF?

Question

How can I create a background color for a complete document page with Quick PDF?

Answer

It's possible to draw a box onto the entire height and width of a page using the DrawBox and SetFillColor functions. Here is some C# sample code that demonstrates how to load an existing PDF, draw the colored box onto the entire first page of the document and then save it to disk.

QP.LoadFromFile("test.pdf");
QP.SelectPage(1);
QP.SetOrigin(1);
int pHeight = QP.PageHeight();
int pWidth = QP.PageWidth();
QP.SetFillColor(1.0,0.0,0.0);
QP.DrawBox(0, 0, pWidth, pHeight, 1);
QP.SaveToFile("test_background_color.pdf");

© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum