Home > Forum > ASP.NET > How to change background color to pdf document in .net? please send me code?

How to change background color to pdf document in .net? please send me code?

by siva ganesh   on Oct 15, 2013   Category: ASP.NET  |  Views: 3770    |  Points: 5   |  Starter 
  Reply
I have old pdf that background color is dark.so,change the background color white using c# coding.

Bookmark and Share:
 
  User Reply  | Ask a question  |   Reply 
  Re :How to change background color to pdf document in .net? please send me code?   
by Thamil
on Oct 19 2013 12:52PM
Points : 10
Gold 
Hello siva,

Please refer the below link

http://stackoverflow.com/questions/12258433/change-pdf-text-color-in-c-sharp
http://stackoverflow.com/questions/17983813/itextsharp-html-to-pdf-with-background-color-for-font
http://stackoverflow.com/questions/11587218/how-to-set-background-color-of-html-table-for-output-to-pdf-with-itextsharp
  Re :How to change background color to pdf document in .net? please send me code?   
by Michael Brown
on Mar 7 2016 12:06AM
Points : 10
Starter 
You can use a free .net pdf library to change the page background color of pdf document:
http://www.e-iceblue.com/Introduce/free-pdf-component.html

Refer to following code:

using System.Drawing;
using Spire.Pdf;

namespace Change_PDF_Background_Color
{
class Program
{
static void Main(string[] args)
{
PdfDocument doc = new PdfDocument();
doc.LoadFromFile("sample.pdf");
PdfPageBase page = doc.Pages[0];
page.BackgroundColor = Color.Chocolate;

doc.SaveToFile("NewColor.pdf");
System.Diagnostics.Process.Start("NewColor.pdf");
}
}
}

Recent Post

Latest Posts