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

Free Support Forum - aspose.com

Stamp Transparency/Opacity not being applied

Using the code below the opacity is not being applied to the PDF stamp. Using version 19.2 o Aspose.Pdf

Try
Dim Temp As String = Path.GetDirectoryName(SourceFile) & “” & Path.GetFileNameWithoutExtension(SourceFile) & “.overlay”
File.Copy(SourceFile, Temp, True)

        Dim doc As New Aspose.Pdf.Document(Temp)
        Dim pageStamp As New Aspose.Pdf.PdfPageStamp(OverlayFile, 1) With {.Background = True, .Opacity = 0.05}


        For i = 1 To doc.Pages.Count
            doc.Pages(i).AddStamp(pageStamp)
        Next

        doc.Save(SourceFile)

        If File.Exists(Temp) Then File.Delete(Temp)

        Return True

    Catch ex As Exception
        Return False
    End Try

@elementz

Thank you for contacting support.

Would you please share source and generated files with us so that we may try to reproduce and investigate it in our environment.

Public Shared Function PdfOverlayTransparent(ByVal SourceFile As String, ByVal OverlayFile As String, StartingOrdinalPageNumber As Integer, TransparencyLevel As Double) As Boolean

    licensePDF.SetLicense("Aspose.Total.lic")

    Try
        Dim Temp As String = Path.GetDirectoryName(SourceFile) & "\" & Path.GetFileNameWithoutExtension(SourceFile) & ".overlay"
        File.Copy(SourceFile, Temp, True)

        Dim doc As New Aspose.Pdf.Document(Temp)
        Dim pageStamp As New Aspose.Pdf.PdfPageStamp(OverlayFile, 1) With {.Background = True, .Opacity = 0.5}

        'Aspose PDF starts on page 1 not 0
        StartingOrdinalPageNumber += 1

        For i = StartingOrdinalPageNumber To doc.Pages.Count
            doc.Pages(i).AddStamp(pageStamp)
        Next

        doc.Save(SourceFile)

        If File.Exists(Temp) Then File.Delete(Temp)

        Return True

    Catch ex As Exception
        Return False
    End Try

End Function

InvoiceOverlay.pdf (381.5 KB)
HCL_AR Invoice_2019-03.pdf (1.2 MB)

@elementz

Thank you for elaborating it further.

We have logged a ticket with ID PDFNET-46109 in our issue management system for detailed investigations. We will let you know as soon as some significant updates will be available in this regard.

Any idea on an ETA for this fix?

@elementz

We are afraid any update may not be available as it has been logged few weeks ago. It may take some months before it is scheduled. We will update you as soon as any information will be available.

However, we also offer Paid Support, where issues are used to be investigated with higher priority. In case your reported issue is a blocker, you may please consider subscribing for Paid Support. For further information, please visit Paid Support FAQs.