Yesterday I was experimenting with “headless” printing (i.e. without user interaction) of PDF to a defined printer.
Based on AI advice I used PdfiumViewer
I installed PdfiumViewer package and used the following code:
Using document = PdfDocument.Load(file)
Using pd = document.CreatePrintDocument()
pd.PrinterSettings = New System.Drawing.Printing.PrinterSettings()
pd.PrinterSettings.PrinterName = "Microsoft Print to PDF"
pd.PrinterSettings.PrintFileName = "new.pdf"
pd.PrinterSettings.PrintToFile = True
pd.Print()
End Using
End Using
The code however throwned error “Unable to load DLL ‘pdfium.dll’ or one of its dependencies”
I was therefore searching for a package containing the missing DLL and finally installed bblanchon.PDFiumV8.Win32
It installed the missing library but I was till gettgin the same error.
Finally I copied pdfium.dll into C:\WIndows\Systems32 folder and the error vanished.
Same result I achieved by copying pdfium.dll into UiPath project root folder.
However, I am not sure if this is the right approach.
Can someone advise what I did wrong?
Sorry, but it makes sense that the above mentioned code would be in a library.
You really want packages and dependencies to be available in your Orchestrator Tenant if you want to be as flexible as possible, that way its possible for robots across different VM’s/environments to fetch it from a central location.
Here’s a link to the nuget package for PdfiumViewer NuGet Gallery | PdfiumViewer 2.13.0, if you upload it to your orchestrator you should be covered.
The problem is not lack of PdfiumViewer package and the corresponding PdfiumViewer.dll.
The problem is missing pdfium.dll that is not part of PdfiumViewer package.
I installed package bblanchon.PDFiumV8.Win32 that contains the missing DLL but UiPath can not see the DLL for what ever reason