Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 7 Jahren, 8 Monaten
Letzter Beitrag:
vor 4 Jahren, 7 Monaten
Beteiligte Autoren:
Abigail Klinton, Fabrice Harari, arronwall, Piet van Zanten, fdimage, Rob Berry

Printing an image in a webpage

Startbeitrag von Rob Berry am 27.10.2010 13:42

Hi All,
I hope someone can help. I have the following code in a page. The stucture of the the page is a group of tabs and on one tab is an image managment. Very simular to the ww_image example. I am trying to send an image to the printer. I have the following code in the click (server) code of the button. It doesn't work, it appears to send a blank page to the printer and the printer will print a blank page. the image is a .jpg.
Thanks,
Rob
CODE:

IF fFileExist(IMG_Image1) THEN
Info("The file "+ IMG_Image1 +" exists on disk")
END
Info("picture file name =" +IMG_Image1)
// Retrieve the characteristics of the current printer
CurrentPrinter is string = iInfoPrinter()
// Retrieve the characteristics of the default printer
DefaultPrinter is string = iInfoPrinter(False)
// Display an information dialog box
Info("The current printer is: " + CurrentPrinter + CR +...
"The default printer is: " + DefaultPrinter)

iPrintImage(IMG_Image1,10,10,200,180)
iEndPrinting()

Antworten:

first, you should choose a default image programme to open the images and then click the button. if you want some codes, here are some, take a look, i think you can print an image vb in a webpage now.

von fdimage - am 18.06.2013 09:33
Hi Rob,

Can you explain why you would want to print an image on the webserver? In most cases there's no printer attached and there's no one available to send it to the user by snailmail.
The way to go is to create a report that will "print" the image using iDestination(iGenericPDF, FileName) then iPrintReport(RPT_Image) and finally FileDisplay(FileName, "application/pdf") and fDelete(FileName)

Also, if the image exists, you display three dialogs in a row, some browsers will complain about that, because it is not very user friendly.
The first dialog reports if the image is present, but just continues if it does not. Not very helpful.
You'd better reverse this to if not XXXX then INFO(XXX);return. The rest of the info can easily be combined in one dialog.

Regards,
Piet

von Piet van Zanten - am 18.06.2013 12:15
Quote
fdimage
first, you should choose a default image programme to open the images and then click the button. if you want some codes, here are some, take a look, i think you can print an image vb in a webpage now.

I'm a little confused, should the files be converted to PDF or send it to the printer directly?

von arronwall - am 28.06.2013 08:16
Quote
fdimage
first, you should choose a default image programme to open the images and then click the button. if you want some codes, here are some, take a look, i think you can print an image vb in a webpage now.

Hi there
Thanks for your sharing.But it is difficult for me to print the image using a code.Is there any easier method to do that?Thanks a lot.

von Abigail Klinton - am 27.11.2013 06:55
Hi Abigail

your code, as it exists, should work IF (and only if) the image has been previously uploaded on the server, and if a printer is present on the server (your code will print the image on the server printer, NOT on the user printer)

Is that really what you want to do? I'm getting the feeling that you want to print an image that is on the client side, and to print it on the client printer

Please, give us a little more information on what you want to do

Best regards

von Fabrice Harari - am 27.11.2013 21:01
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.