Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Feb 06, 2018 12:02 pm

Hi,

When I set the security.encryption on a pdf document, regardless of what PdfPermissionFlags I use, the setting "Page Extraction" is set to "not allowed".

How can I enabled Page extraction in my output PDF files?


Here's the code I'm using to merge files;

Code: Select all
Private Shared Sub MergeFiles(filename As String, files As String(), pw As String, encryption As PDFEncryptionLevel, info As PDFDocInfo)

            Try

                Using doc As PdfDocumentBase = PdfDocument.MergeFiles(files)

                    Try
                        '// Set the doc properties

                        Dim Keywords As New List(Of String)
                        For Each file In files
                            Keywords.Add(Path.GetFileNameWithoutExtension(file))
                        Next

                        doc.DocumentInformation.Keywords = String.Join(", ", Keywords)
                        doc.FileStructure.Version = PdfVersion.Version1_7

                        If Not IsNothing(info) Then
                            doc.DocumentInformation.Title = info.Title
                            doc.DocumentInformation.Author = info.Author
                            doc.DocumentInformation.Creator = info.Creator
                            doc.DocumentInformation.Producer = info.Producer
                        End If


                        If Not String.IsNullOrWhiteSpace(pw) Then

                            Dim permissions = PdfPermissionsFlags.Print Or PdfPermissionsFlags.EditContent Or
                                                        PdfPermissionsFlags.CopyContent Or PdfPermissionsFlags.EditAnnotations Or
                                                        PdfPermissionsFlags.FillFields Or PdfPermissionsFlags.AccessibilityCopyContent Or
                                                        PdfPermissionsFlags.AssembleDocument Or PdfPermissionsFlags.FullQualityPrint
                             '// all permissions


                            Select Case encryption
                                Case PDFEncryptionLevel.None
                                    '// None...
                                Case PDFEncryptionLevel.Key128
                                    doc.Security.Encrypt(pw, OwnerPW, permissions, PdfEncryptionKeySize.Key128Bit)

                                Case PDFEncryptionLevel.Key256
                                    doc.Security.Encrypt(pw, OwnerPW, permissions, PdfEncryptionKeySize.Key256Bit)

                                Case Else
                                    Throw New NotImplementedException("Unknown PDFEncryptionLevel")
                            End Select

                        End If


                        Try
                            '// doc.Conformance = PdfConformanceLevel.Pdf_A1A
                            doc.Save(filename, FileFormat.PDF)
                            doc.Close()
                        Catch ex As Exception
                            Throw
                        End Try


                    Catch ex As Exception
                        Throw
                    End Try

                End Using

            Catch ex As Exception
                Throw
            End Try

        End Sub

[email protected]
 
Posts: 1
Joined: Tue Jul 19, 2016 9:06 am

Wed Feb 07, 2018 10:01 am

Hello,

Thanks for your inquiry.
The default permissions for different Pdf readers are inconsistent. Could you please provide the information of your pdf Reader as well as your documents (input documents and generated document) to help us have a better investigation? You could send them to us via email([email protected]). Thanks in advance.

Sincerely,
Nina
E-iceblue support team.
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.PDF

cron