PD4ML v4 Forums PD4ML v3 Archived Forums (Read Only) Troubleshooting Skip watermark for specific page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #27119

    Hello,

    I am using PD4ML in .net. i have applied watermark in my PDF but i want to remove watermark from first page of pdf.

    footer.InitialPageNumber = 2;
    footer.PagesToSkip = 1;
    //PD4PageMark watermark = new PD4PageMark();
    footer.setWatermark(
    // watermark image location URL.
    // For local images use “file:” protocol i.e. “file:images/logo.png”
    watermark,
    // watermark image position
    new Rectangle(((792 – WaterMarkWidth) / 3), 300, WaterMarkWidth, WatermarkHeight),

    // watermark opacity in percents
    40);

    I am using this code, please advice me how to skip watermark for first page.

    Thanks in advance.

    #29982

    It is not possible with the watermarking feature. But you can achieve something visually identical with page background images.

    Try to override getPageBackgroundImageUrl(int pageNumber) method as it is done for getHtmlTemplate() method in the code snippet below (implementing the logic you need):

    [language=java:2rrc4msf]PD4PageMark footer = new PD4PageMark() {
    public String getHtmlTemplate(int pageNumber) {
    if ( pageNumber % 2 == 0 ) {
    return “some left aligned stuff…”;
    } else {
    return “some right aligned stuff…”;
    }
    }
    };
    pd4ml.setPageFooter(footer);[/language:2rrc4msf]

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Troubleshooting’ is closed to new topics and replies.