On your uploaded PDF file I can only see w white background?
I have set the BackgroudOpacity to 0.8f, but this does 2 things:
1. It makes the background image clearer (less faded) and close to the original, which is good.
2. Sadly the 0.8f Opacity also makes the orginal text on the PDF file less clearer.
It seems that the 0.8f opacity for the background image makes the text on the original PDF file (where the image is attached to) 0.2f, and vice versa, when I adjust the backgroudopacity to 0.2f it seems that it makes the original text opacity 0.8f..
To let you show the results:
I have used your attached PDF example as the original PDF file (posted as print screen now):

Then I have the following jpg background image that I want to attach as background on the original PDF:

I am using the following bit of code to attach the background image to your PDF file:
- Code: Select all
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(OriginalPDFDocumentPath);
foreach (PdfPageBase page in doc.Pages)
{
page.BackgroundImage = Image.FromFile(BackgroundImagePath);
page.BackgroudOpacity = 0.8f;
}
string output = "result.pdf";
doc.SaveToFile(SavePDFAsAndToLocationPath);
Where the OriginalPDFDocumentPath is the path to your PDF file, BackgroundImagePath is the path to the background jpg and the SavePDFAsAndToLocationPath is the file path where I am saving the combined PDF to.
With using 0.8f as opacity I get this result:

As you can see, the background image (don't mind the stretching of the image) is nearly the same (color wise) but the original PDF text get's faded (the opacity of the text seems to get less).
