logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

New Topic Post Reply
Options
Go to last post Go to first unread
Guest  
#1 Posted : Saturday, January 20, 2018 5:31:50 PM(UTC)
Quote
Guest

Rank: Guest

Groups: Guests
Joined: 1/5/2016(UTC)
Posts: 162

Was thanked: 5 time(s) in 5 post(s)
Hi
Trying to use pdfium to print a pdf document straight to printer from vb .net winforms project.
Deployment environment is four computers accessing a single network drive. Setup files are on the network drive, install the program from network drive onto each of the four workstations. Every aspect of the program works fine on deployment except printing pdf documents. Can generate the document and view or email it but cant print it without first displaying in default pdf viewer.

Downloaded Pdfium.Net.SDK and Pdfiumviewer from NuGet.
In the following code the first line PdfCommon.Initialize gives me error: Unable to load DLL 'pdfium.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

<code>
Try
PdfCommon.Initialize()
Dim doc As Patagames.Pdf.Net.PdfDocument = Patagames.Pdf.Net.PdfDocument.Load(strPDF)
Dim printDoc As New PdfPrintDocument(doc)
Dim PrintController As PrintController = New StandardPrintController()
printDoc.PrintController = PrintController
printDoc.Print()
Return True
Catch ex As Exception
MessageBox.Show(ex.Message, ex.GetType.ToString)
Return False
End Try
</code>

In my project folder (PPM) are subfolders x64 and x86 both of which contain a single file called pdfium.dll
In PPM\Debug\Bin are patagames and pdfiumviewer dlls as well as subfolders x64 and x86 each of which contain just pdfium.dll
On my development computer I can get it to print only if I include the path C:\...\Projects\PPM\PPM\x64\pdfium.dll in the initialise statement, obviously however the path on deployment will be different. If I leave the path out it doesn't work either on my development or deployment computers
My project has references to Patagames.pdf, Patagames.pdf.winforms, patagames.pdf.wpf, pdfiumviewer and pdffilewriter (all are set to copy local = true)
In Solution Explorer are subfolders x64 and x86 and the pdfium.dll in both those are set to Copy Always.
The class module containing this code has Imports System.Drawing.Printing, Imports System.IO, Imports Patagames.Pdf.Net, Imports Patagames.Pdf.Net.Controls.WinForms

Clearly I am doing something wrong as pdfium.dll is not being found on the deployment computers (or on the development computer unless I specify the path)

Ive been trying to get this to work for several weeks now without bothering you but now at wits end.
Grateful for any suggestions.
Paul Rayman  
#2 Posted : Monday, January 22, 2018 6:45:04 PM(UTC)
Quote
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
Quick Reply Show Quick Reply
Users browsing this topic
Guest (2)
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.