PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Apr 28, 2024 5:46 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Dec 23, 2012 5:12 pm 
Offline

Joined: Sun Dec 23, 2012 4:48 pm
Posts: 2
I just downloaded Version 1.32 DLLs, and am attempting to write an application in VB.Net that will allow me to password-protect a PDF file.
I was successful in using the supplied VB.Net sample that creates "HelloWorld.pdf", and managed to traslate the C# code from the Wiki that supplies a password for the file. I am using PDFSharp.dll, and have added a reference to it.

However, if I try to use PDFReader.Open(), the compiler does not recognize it, saying that it is not declared. Other functions, like AddPage, OwnerPassword, etc. are all recognized and do their jobs.

Here is the first part of the code...

Code:
Option Strict On
Option Explicit On

Imports PdfSharp
Imports PdfSharp.Drawing
Imports PdfSharp.Pdf

Public Class Form1
    Dim document As PdfDocument = New PdfDocument

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Try
            document = PdfReader.Open("HelloWorld.pdf")
        Catch ex As Exception
            Debug.Print(ex.ToString)
        End Try


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 23, 2012 10:55 pm 
Offline

Joined: Sun Dec 23, 2012 4:48 pm
Posts: 2
I managed to get it running. Turns out I had to use:
Code:
Imports PdfSharp.Pdf.IO

Rookie mistake, I guess.
Thanks for a great library, BTW!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 341 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group