Convert WORD to PDF and set permissions- V10.0


I recently downloaded your latest version of word, PDF and PDF.Kit. We have been using PDF and PDF.Kit for almost 3 years. Based on the post below, I want to see if we can remove PDF.Kit from our code.

My requirement is

  1. Generate WORD letter from template and bookmarks.
  2. Store the WORD letter as blob in database.
  3. Send letter as PDF to server and then to client (3-tier arch)
  4. Disable all permissions on PDF except printing.

First three works fine. When I set permissions using encryptiondetails class, it takes a lot of time for the letter to open on client workstation. To set permissions, do I have to go through encryption (and its algorithm)? Is there any other way?

My only option now is to go back to old code and use PDF.Kit to set privileges. If so, another question, till what time/date will you support PDF.Kit if you plan on merging with PDF?

Here is the code:

'Protect document as read only - commented for testing
lv_document.Protect(Aspose.Words.ProtectionType.ReadOnly, "toad245")
'Save output letter in word using memory stream
lv_document.Save(lv_out_stream, Aspose.Words.SaveFormat.Doc)
'Rewind the stream position to zero so it is ready for next reader.
lv_out_stream.Position = 0
'Read stream into blob
lv_out_letter_blob = New System.IO.BinaryReader(lv_out_stream)
li_len_out_stream = lv_out_stream.Length
resp.CCFS_letter_word.Value = lv_out_letter_blob.ReadBytes(li_len_out_stream)
'Get letter mode
lv_letter_mode = Request.CCFS_letter_Data.letter_view_mode
'save output in Pdf if view mode is PDF
If lv_letter_mode = "PDF" Then
'Re-initialize stream to be used for created pdf
lv_out_stream = Nothing
lv_out_letter_blob = Nothing
lv_out_stream = New System.IO.MemoryStream
'define pdf save options
Dim lv_pdfsaveoptions As Aspose.Words.Saving.PdfSaveOptions = New Aspose.Words.Saving.PdfSaveOptions()
lv_pdfsaveoptions.SaveFormat = Aspose.Words.SaveFormat.Pdf
'define pdf encription details with permissions
Dim lv_pdfencriptiondetails As Aspose.Words.Saving.PdfEncryptionDetails
'I used both types of algorithms 128 and 40, same issue
lv_pdfencriptiondetails = New Aspose.Words.Saving.PdfEncryptionDetails(String.Empty, "toad245", Aspose.Words.Saving.PdfEncryptionAlgorithm.RC4_40)
lv_pdfencriptiondetails.Permissions = Aspose.Words.Saving.PdfPermissions.DisallowAll
lv_pdfencriptiondetails.Permissions = Aspose.Words.Saving.PdfPermissions.Printing
lv_pdfsaveoptions.EncryptionDetails = lv_pdfencriptiondetails
'save as pdf
lv_document.Save(lv_out_stream, lv_pdfsaveoptions)
'Rewind the stream position to zero so it is ready for next reader.
lv_out_stream.Position = 0
lv_out_letter_blob = New System.IO.BinaryReader(lv_out_stream)
li_len_out_stream = lv_out_stream.Length
resp.CCFS_letter_pdf.Value = lv_out_letter_blob.ReadBytes(li_len_out_stream)
End If


Thank you for your inquiry.
There is no other possibility to set permissions.
Could you clarify how many pages in your documents and how much images they have. I tried to convert a large document (200+ pages) with lots of graphics. I did not notice any time delay between opening of the crypted and simple document. Perhaps the reason is not in it? Please attach a sample document for analysis.

About plans of development Aspose.Pdf.Kit component is best to ask on the forum of this team.