Hello,

This is my code (in VB.Net), using unprotect password process, but I do not 
know really how to do to remove the watermark and then save my file ...
Please help....

Annots id Nothing ... Which is the property to use ? CONTENTS seems not working 
also...

The PDF has been generated with Acrobat Std. The watermark is added as a Gif.


Private Sub Remove_Password_PDF(ByVal F_FullName As String, ByVal F_Name As 
String, ByVal Dir_Out As String)
        Dim myFile As String
        Dim subrep As String
        Dim NewDir As String
        Dim password As String = "xxxxxx"

        Dim i, j As Integer
        Dim nb_pages As Integer

        subrep = Get_Dir_File(F_Name)
        NewDir = Path.Combine(Dir_Out, subrep)
        If Directory.Exists(NewDir) Then
            'Ne rien Faire
        Else
            Directory.CreateDirectory(NewDir)

        End If

        myFile = Path.Combine(Dir_Out, subrep, F_Name)

        Dim pdf_reader As New PdfReader(F_FullName, New 
System.Text.ASCIIEncoding().GetBytes(password))

        nb_pages = pdf_reader.NumberOfPages

        Dim page As PdfDictionary
        Dim annot As PdfDictionary
        Dim annots As PdfArray
        Dim content As PdfString
        Dim Rcontent As PdfStream

        For i = 1 To nb_pages
            page = pdf_reader.GetPageN(i)
            annots = page.GetAsArray(PdfName.ANNOTS)

            If annots IsNot Nothing Then

                    'Code to add here to remove WaterMark which is the overlayer

            End If

        Next








        Dim pdf_stamper As New PdfStamper(pdf_reader, New FileStream(myFile, 
System.IO.FileMode.Create))

        pdf_reader.Close()
        pdf_stamper.Close()


    End Sub


________________________________

Recipharm Legal Notice:

The information transmitted may contain confidential material and
is intended only for the person or entity to which it is
addressed. Any review, retransmission, dissemination or other
use of, or taking of any action by persons or entities other than
the intended recipient is prohibited. If you are not the
intended recipient, please delete the information from your
system and contact the sender.
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to