PdfiumViewer.DLL implementation in ABL Code

JeFernando

New Member
I am trying to implement PdfiumViewer to have more control over my pdf printing (orientation, page size, tray etc.). I have generated its DLL file and placed in session directory along with newly created assemblies.xml file. But its not recognizing my Class definition still.
I already got the basic printing in place with printer name, no of copies using OS-Commands/3rd applications but adding above parameters is making the task more challenging hence now trying .NET codes.

USING PdfiumViewer.* FROM ASSEMBLY.
DEFINE VARIABLE val AS CLASS PdfDocument NO-UNDO.

Any Suggestions what I could be missing or what else could I try for my use case.
Using: Progress 11.5, 2012Server.
Thanks Ahead.
 

Osborne

Active Member
Adding to assemblies.xml and placing in the session directory is correct so should work.

You say you generated the DLL file so have you created it yourself? If so, can you attach so can have a quick check. If not, where was it downloaded from?
 

JeFernando

New Member
Adding to assemblies.xml and placing in the session directory is correct so should work.

You say you generated the DLL file so have you created it yourself? If so, can you attach so can have a quick check. If not, where was it downloaded from?
Thanks for the reply. So as per the latest development, I was able to make this work. It was the issue with the PdfiumViewer DLL file that in fact need another pdfium.DLL to work on, I originally downloaded the project from github but it turns out the same project on the Nuget libraries works the best (as it has both the DLL combined or something, IDK I am not very good in VS/c# working.. :) ).
Now ahead is the task to implement the printer and page settings for this. Wish me luck!
I am taking my inspiration from this post, hopefully it might work. Any heads ups will be appreciated.
stackoverflow . com /a/41751184/15155018/
 

JeFernando

New Member
Almost forgot, in assemblies.xml the PublicKeyToken should not be null, which was the case when created DLL from my own. The Nuget file has this PublicKeyToken which picks up in no time.
And after some work, Finally able to achieve what I wanted, In case someone wanted putting code here to have more control for PDF printing.
Regards.

Code:
USING PdfiumViewer.*.   
DEFINE VAR print AS PrintPDFPrint.
print = NEW  PrintPDFPrint().
IF print:PrintPDF("Microsoft Print to PDF (redirected 4)","Letter","Trader.pdf",01,FALSE) THEN
MESSAGE "TRUE"
    VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
ELSE
MESSAGE "FALSE"
    VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.

For below c# code (Created this new method in PdfiumViewer project)
C#:
 public class PrintPDFPrint
    {       
        public bool PrintPDF(string printer, string paperName, string filename, int copies, bool Landscape)
        {
        
        }
 
Top