Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

aspose-pdf: Security.setUserPassword does not work after V 4.2.1

$
0
0
Hello,

we were always using the Aspose Pdf 3.0.1 for Java and the following program was working for us:
import aspose.pdf.Pdf;
import aspose.pdf.Section;
import aspose.pdf.Security;
import aspose.pdf.Text;

public class Test {
    public static void main (String args[]) throws Exception {
        Pdf pdf = new Pdf();
       
        Security pdfSecurity = new Security();
        pdfSecurity.setUserPassword("123");
        pdf.setSecurity(pdfSecurity);
       
        Section section = pdf.getSections().add();
        section.getParagraphs().add(new Text("bolabla"));
       
        pdf.save("d:\\temp\\1\\2.pdf");
    }
}
Recently we have updated to V. 9.3.0. But now PDF files generated by this simple program can not be opened with Acrobat Reader anymore. Acrobat asks for the password, you type "123", and it says "The password is wrong".

I have tried different versions but this functionality seems to get broken on the version 4.3.0, as with the 4.2.1 it is still working.

Am I doing something wrong? Or what? Please explain.

Igor


Viewing all articles
Browse latest Browse all 3131

Trending Articles