Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
8999 มุมมอง

I was trying to generate a pdf using  rml report. I want to secure it using a password. How can I do that in Odoo 8.0 ?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

you have to encrypt the pdf file using code
i hope this code will help you .


import sys

from pyPdf import PdfFileWriter, PdfFileReader

 

 def secure_pdf(InPdf, OutPassPdf, Passwd):

     output = PdfFileWriter()

     input1 = PdfFileReader(file(InPdf, "rb"))

     for i in range(0, input1.getNumPages()):

         output.addPage(input1.getPage(i))

     outputStream = file(OutPassPdf, "wb")

     output.encrypt(Passwd, use_128bit=True)

     output._header

     output.write(outputStream)

     outputStream.close()

     return True

     

secure_pdf("/Input.pdf",

           "/OutPut.pdf",

           str(email_id))


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

https://apps.odoo.com/apps/modules/17.0/odoo_pdf_security

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

There are various solutions available to apply the password to your PDF file. I checked many solutions and come with an amazing tool named Softaken PDF Protector Tool which simply lock your PDF file and restrict others to open it without knowing the password. 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

This app will also helpful: https://apps.odoo.com/apps/modules/13.0/password_protected_pdf/

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
เม.ย. 18
4166
2
มี.ค. 15
9204
Report: How to use page break in a <tr> แก้ไขแล้ว
5
มิ.ย. 18
17073
0
ก.ย. 15
4210
3
ก.ค. 24
8772