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.

Thu Apr 05, 2018 10:45 pm

We are trying freespire.pdf to see if it can work for us to pull a pdf gift card from a remote server and print at the printer set as windows default. Using VB.net we have a simple textbox and button on a form with the code below as the button action.

I get stuck at LoadFromHtml the program hits that line and then exits the sub entirely. Not sure what to do

Code: Select all
 Dim remoteUrl As String = "https://.../gift-cards/" & txtCardNumber.Text & ".pdf"

        Dim pdf As PdfDocument = New PdfDocument
        pdf.LoadFromHTML(remoteUrl, 0, 0, 1)
        pdf.PrintDocument.Print()

robriver
 
Posts: 2
Joined: Thu Apr 05, 2018 10:30 pm

Fri Apr 06, 2018 3:45 am

Hello,

Thank you for contacting us.
The issue is caused by that you used a wrong way to load a Pdf from Url. Please refer to below sample code to try again.
Code: Select all
Using webClient As New WebClient()
    Dim data() As Byte = webClient.DownloadData(PdfUrl)
    Using stream As New MemoryStream(data)
         Dim pdf As PdfDocument = New PdfDocument(stream)
    End Using
End Using

Sincerely,
Nina
E-iceblue support team
User avatar

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

Fri Apr 06, 2018 9:05 pm

I get error now on on (Stream) too many arguments from your example.

Code: Select all
Dim pdf As PdfDocument = New PdfDocument(stream)

robriver
 
Posts: 2
Joined: Thu Apr 05, 2018 10:30 pm

Mon Apr 09, 2018 2:00 am

Hello,

Thanks for your feedback.
I forgot to tell you earlier that the free version doesn't support loading stream. Sorry for that. Please upgrade to our commercial version Spire.PDF Pack(Hot Fix) Version:4.4.0 to have a test.

Sincerely,
Nina
E-iceblue support team
User avatar

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

Wed Apr 11, 2018 7:27 am

Hello,

Greetings from E-iceblue.
Have you tested commercial version? Has your issue been resolved?
You feedback will be greatly appreciated.

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