$63 GRAYBYTE WORDPRESS FILE MANAGER $11

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.23
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/libharu/usr/share/libharu/bindings/vb.net/demo/

HOME
Current File : /opt/alt/libharu/usr/share/libharu/bindings/vb.net/demo//Permission.vb
Imports HPdf

Module Permission

    Sub Main()
        Const owner_passwd As String = "owner"
        Const user_passwd As String = ""
        Const text As String = "User cannot print and copy this document."
        Console.WriteLine("libhpdf-" + HPdfDoc.HPdfGetVersion())

        Try
            Dim pdf As HPdfDoc = New HPdfDoc()

            ' create default-font 
            Dim font As HPdfFont = pdf.GetFont("Helvetica", Nothing)

            ' add a new page object. 
            Dim page As HPdfPage = pdf.AddPage()

            page.SetSize(HPdfPageSizes.HPDF_PAGE_SIZE_B5, HPdfPageDirection.HPDF_PAGE_LANDSCAPE)

            page.BeginText()
            page.SetFontAndSize(font, 20)
            Dim tw As Single = page.TextWidth(text)
            page.MoveTextPos((page.GetWidth() - tw) / 2, (page.GetHeight() - 20) / 2)
            page.ShowText(text)
            page.EndText()

            pdf.SetPassword(owner_passwd, user_passwd)
            pdf.SetPermission(HPdfDoc.HPDF_ENABLE_READ)

            ' use 128 bit revision 3 encryption
            pdf.SetEncryptionMode(HPdfEncryptMode.HPDF_ENCRYPT_R3, 16)

            ' save the document to a file
            pdf.SaveToFile("Permission.pdf")

        Catch ex As Exception
            Console.Error.WriteLine(ex.Message)
        End Try
    End Sub
End Module


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
8 Apr 2026 8.33 AM
root / root
0755
Encryption.vb
1.171 KB
11 Mar 2025 2.13 PM
root / root
0644
FontDemo.vb
2.746 KB
11 Mar 2025 2.13 PM
root / root
0644
ImageDemo.vb
5.028 KB
11 Mar 2025 2.13 PM
root / root
0644
LineDemo.vb
8.859 KB
11 Mar 2025 2.13 PM
root / root
0644
OutlineDemo.vb
2.454 KB
11 Mar 2025 2.13 PM
root / root
0644
Permission.vb
1.347 KB
11 Mar 2025 2.13 PM
root / root
0644
RawImageDemo.vb
2.924 KB
11 Mar 2025 2.13 PM
root / root
0644
SlideShowDemo.vb
5.132 KB
11 Mar 2025 2.13 PM
root / root
0644
TextDemo.vb
9.457 KB
11 Mar 2025 2.13 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF