We're sorry Aspose doesn't work properply without JavaScript enabled.

# Text note appearing over the floting box

the text manish is not displayed on image pdf-header1.png which is on header of pdf

Aspose.Pdf.Pdf document = new Aspose.Pdf.Pdf();

Aspose.Pdf.Watermarks _wortermark = new Aspose.Pdf.Watermarks();Aspose.Pdf.

FloatingBox _fbox = new Aspose.Pdf.FloatingBox();

_fbox.Top = 83;

Aspose.Pdf.Image imgleftImg = new Aspose.Pdf.Image();

imgleftImg.ImageInfo.File = Server.MapPath("../images/pdf-left.png");imgleftImg.ImageInfo.ImageFileType = Aspose.Pdf.

ImageFileType.Png;imgleftImg.IsNeedRepeating = true;

imgleftImg.ImageInfo.FixHeight = 718;

imgleftImg.ImageInfo.FixWidth = 30;

imgleftImg.IsImageFitToRowHeight = true;

document.Watermarks = _wortermark;

setSectionSettings(pageSec);

clsDataLayerCommonDB _clsCommanDB = new clsDataLayerCommonDB();

This message was posted using Aspose.Live 2 Forum

Hello Manish,

In order to display the text over the watermark being added to the document, please try setting the value of IsWatermarkOnTop property of Pdf class to false. But, I'm afraid in current version, if the text is placed inside the Header section and we set the value of IsWatermarkOnTop to false, still the text is being displayed behind it. For the sake of correction, I have logged it in our issue tracking system as PDFNET-15182. We will investigate this issue in details and will keep you updated on the status of a correction.

You may also check that if the text object is placed inside the Section element, and we place the Watermark over it, the text is properly being displayed. A sample PDF document is in attachment. Please take a look.

We apologize for your inconvenience.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

yes, i have also done it but i want to repeat the text as header, which is not posible using section.

let me know you finding on header text over floating box.

Hello Manish,

At the moment watermark support exits in page section only and our development team is working hard to make it available in the header area. However you can try using a workaround to accomplish your requirement. So In order to make the header watermark behind header text, please use floating box positioning BoxVerticalPositioningType.Paragraph, and also set the paragraph ID i.e.

fbox2.ReferenceParagraphID = "float_2";
Please take a look over the following complete code snippet.
[C#]

//Instantiate a Pdf object by calling its empty constructor
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
//Create a section in the Pdf object

//Create an image object in the section
Aspose.Pdf.Image imgleftImg = new Aspose.Pdf.Image();
//Set the path of image file
imgleftImg.ImageInfo.File = @"d:/pdftest/Aspose.jpg";
FloatingBox fbox = new Aspose.Pdf.FloatingBox();
fbox.ZIndex = -1;
fbox.BoxHorizontalPositioning = BoxHorizontalPositioningType.Margin;
fbox.BoxHorizontalAlignment = BoxHorizontalAlignmentType.Left;
fbox.BoxVerticalPositioning = BoxVerticalPositioningType.Margin;
fbox.BoxVerticalAlignment = BoxVerticalAlignmentType.Top;
pdf.IsWatermarkOnTop = false;

// create sample text to be added to PDF section
for (int i = 0; i <= 5; i++)
{
section.Paragraphs.Add(new Text("page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text page text "));
}

// create a simple text object

// specify the color information for text object
// specify the font name information for text object
//Set the header of odd pages of the PDF document
//Set the header of even pages of the PDF document

FloatingBox fbox2 = new Aspose.Pdf.FloatingBox();
// add the image to paragraphs collection of floatingbox
// set the ZIndex order for FloatingBox. Floating box with negative ZIndex will be placed behind the text in the page.
fbox2.ZIndex = -1;
fbox2.BoxHorizontalPositioning = BoxHorizontalPositioningType.Margin;
fbox2.BoxHorizontalAlignment = BoxHorizontalAlignmentType.Left;
fbox2.BoxVerticalPositioning = BoxVerticalPositioningType.Paragraph;