I will really appreciate some help with the next issue.
I’m receiving an EPL instruction through a WebService, which I am saving into a BLOL field. I need to send that instruction into a known printer, not the default one. Is there any known instruction todo this, or I should use any type of library? May be Zebra?
What I understand from your tip, is that I should create and EPL file (phisically), and send it to the printer? Must say that the LPE instruction is saved into a blobl field. I solved a similar issue sending a PDF to a printer, from a blob, this way:
//save PDF into directory
lShipment.CALCFIELDS(Sticker);
lTmpBLob.Blob := lShipment.Sticker;
lTempServerFileName := lFileManagement.ServerTempFileName('.pdf');
lFileManagement.BLOBExportToServerFile(lTmpBLob,lTempServerFileName);
FileNameServer := '\\SRV-DC01\navision\XML\Pegatinas\'+lShipment."No."+'.pdf';
lFileManagement.DownloadToFile(lTempServerFileName, FileNameServer);
// // //Send PDf to the printer
Printer := Printer.PdfFilePrinter(FileNameServer);
Printer.DefaultPrinterName := 'Etiquetas Expediciones 2';
Printer.AdobeReaderPath('C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe');
Printer.Print();
Should be something similar to this? Or may be using “ProcessStartInfo”?
In order to find out where it exactly fails start with manually saving a file in a folder where you are sure you have acces to the folder from the Servicetier
and then try to do the printing
As I don't know what dotnet functions you are using specifically then I cannot see if you are doing it 100 procent right.
All I CAN say is that your original way of printing PDF-files is something that I would NEVER do - but you know that from previous discussions [emoticon:c4563cd7d5574777a71c318021cbbcc8]
The folder where I’m creating the EPL file, is the same where I WAS creating the PDF(I say was, because this develompent will replaec the one with the PDFs, don’t know if you will like more… ;-)) . And I see the created EPL file, so this part is working good.
THe folder is the same, and the configuration of the ProcessStarInfo is also the same, and looks very similar to the one you’ve recommend to me. May be it’s a problem generated becasue of the EPL file? That it doesn’t work lile a PDF?
Are you talking about the answers int his post? I think I’m using correctly the instrucions for the ProcessStartInfo, the same way for the PDF,and it was working. May be are you talking about the sheel commands?
I’m also using this link for tips, where we can see the same error I’m having:
But hte error persists, I’m thinking that may be could be a compatibility issue of the EPL, becasue it I right click over the EPL file, I don’t see the “print” option…
Of course I will verify his answer, it’s being really helpful. But the problem is that I still have that small (but really important) problem, and if I mark the post as solved, I won’t have more help with this issue,
How should I do that? It seems that the SHELLcommand can’t be used…
I asigned the Notepad++ as the default aplication for the epl files, and remains equal. I don’t have the “print” option if I right click onto the file, and that seems to be the problem. If in the verb I use “open” instead of “print”, I don’t find that error, so I think that the problem can come from there…
You are trying to do everything in one go, without knowing if you are close to reach your goal. That is why i suggested you to split it into smaller tests.
Can you create a proper file and save it to a folder
Can you do a manual print of that file (this is what i want you to do now)
test that it works in one go.
So can you do a
NET USE LPT1: \computername\printersharename /persistent:yes
PRINT /D:LPT1 C:\MYFILE.EPL
No Palle, I cannot print the file manually. That’s why I first try assigned the default application, hopping that to be solved. If now I open the file with notepad++ (the default app), I can’t print if from inside the app, but as a “text file”. I still don’t having the “print” option in the right click, which is supposely what we are emulating with the “ProcessStartInfo” development.
Of course, the file is properly saved in the drectory
Well it is soo hard to find out what goes wrong in code if you cannot do it manually step by step. It has nothing to do with NotePad++ Besides from that Notepad++ is not designed for printing but development. And as a sidenote you should use Visual Studio Code editor instead (Code.Visualstudio.com) - as this is the new Dynamics NAV development “environment”.
You have to solve the printing issue first. So you can verify that your EPL-file is working. RIght now you have no idea of where you are sending your EPL file to for printing.
Do you have the printerdriver installed? and what port/name etc is it?
it is ALWAYSS possible to do a PRINT of a file. If you dont get the PRINT from command prompt to work, then you will never get it to work in code.
About the printDriver… In our customer’s server, It has 8 different printers installed. I think that he has a few drivers installed… I’l try to figure out hoy to print from command line, and see waht happens…
This issue is driving me mad. I am always self-learning, and I getting really desperate because I know that with a few more knowledgement this should be a quite easy question…