http://bugs.winehq.org/show_bug.cgi?id=30699
Bug #: 30699 Summary: wine printing: barcode is not printed from VB6 application Product: Wine Version: unspecified Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wineps.drv AssignedTo: wine-bugs@winehq.org ReportedBy: edwin+winebugs@etorok.net Classification: Unclassified
Created attachment 40201 --> http://bugs.winehq.org/attachment.cgi?id=40201 barcode screenshot
There is an application provided by the Romanian finance administration for printing Payment sheets with barcodes. I tried to use it in Wine (it appears to be a VB6 application), and I could enter all the data, and it displayed a generated barcode.
However when I tried printing it didn't print the barcode. This happens both when printing to my printer (Samsung ML-2010P), or using CUPS-PDF.
Attached is the PDF produced when printing through CUPS, and a screenshot taken while printing. Notice that on the screenshot there is a barcode in the right towards the top, and in the produced PDF there is no barcode at all.
Attached is also WINEDEBUG=+relay,+seh,+tid,+psdrv output.
How to reproduce (including download URL): 1. Prepare application
mkdir $HOME/.wine-bug export WINEPREFIX=$HOME/.wine-bug # create winedir winecfg # get program wget http://static.anaf.ro/static/10/anaf/aplicatii/op_fv/opfv2010/instal_opfv_28... unzip instal_OPFV_28032012.zip
wine instal_OPFV_2012.exe
# set locale: if date format is wrong program refuses to work export LANG=ro_RO.UTF-8 LANGUAGE=ro_RO.UTF-8 LC_TIME=ro_RO.UTF-8 cd '$HOME/.wine-bug/drive_c/Program Files/OPFV 2012'
# enter test data cat >ordine.txt <<EOF 1,1,1,TEST,1234567897,,,,BUGETUL DE STAT,1234567897,RO26TREZ57820470101XXXXX,,,BUGETUL DE STAT,16/05/2012,FV EOF
2. Make sure you have a printer. Bug reproduces with CUPS-PDF too, so edit $HOME/.wine-bug/drive_c/windows/win.ini, and use these settings for the printer:
[devices] PDF=wineps.drv,CUPS:PDF [PrinterPorts] PDF=wineps.drv,CUPS:PDF,15,45 [windows] device=PDF,wineps.drv,CUPS:PDF
3. Run app wine OPFV_2012.exe
4. Print from the application - Click on "FV" - Choose 1,1,FV from the 'Nr. de ordine, Nr. OP/FV' dropdown - Click "Incarcare" - Click "Listare"
5. Look at the printed document, or PDF and notice that the barcode on the top right is missing in the printout. See attached PDF vs. attached screenshot. The barcode IS visible during printing, its just never printed.
http://bugs.winehq.org/show_bug.cgi?id=30699
--- Comment #1 from Török Edwin edwin+winebugs@etorok.net 2012-05-16 13:47:18 CDT --- Created attachment 40202 --> http://bugs.winehq.org/attachment.cgi?id=40202 CUPS-PDF output when printing
Notice the missing barcode
http://bugs.winehq.org/show_bug.cgi?id=30699
--- Comment #2 from Török Edwin edwin+winebugs@etorok.net 2012-05-16 13:47:45 CDT --- Created attachment 40203 --> http://bugs.winehq.org/attachment.cgi?id=40203 xz compressed WINEDEBUG=+relay,+seh,+tid,+psdrv output
http://bugs.winehq.org/show_bug.cgi?id=30699
--- Comment #3 from Török Edwin edwin+winebugs@etorok.net 2012-05-16 13:48:12 CDT --- Created attachment 40204 --> http://bugs.winehq.org/attachment.cgi?id=40204 just WINEDEBUG=+psdrv output
http://bugs.winehq.org/show_bug.cgi?id=30699
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, printing
http://bugs.winehq.org/show_bug.cgi?id=30699
--- Comment #4 from Török Edwin edwin+winebugs@etorok.net 2012-05-16 15:31:43 CDT --- FWIW the barcode seems to be PDF417 (https://en.wikipedia.org/wiki/PDF417)
http://bugs.winehq.org/show_bug.cgi?id=30699
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- URL| |http://static.anaf.ro/stati | |c/10/anaf/aplicatii/op_fv/o | |pfv2010/instal_opfv_2803201 | |2.zip CC| |adys.wh@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=30699
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com
--- Comment #5 from Bruno Jesus 00cpxxx@gmail.com 2012-09-09 21:00:23 CDT --- The URL went 404, is there any other download link available? Is this still an issue in wine 1.5.12?
http://bugs.winehq.org/show_bug.cgi?id=30699
Török Edwin edwin+winebugs@etorok.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://static.anaf.ro/stati |http://static.anaf.ro/stati |c/10/anaf/aplicatii/op_fv/o |c/10/Anaf/Aplicatii/OP_FV/o |pfv2010/instal_opfv_2803201 |pfv2012/instal_OPFV_2308201 |2.zip |2.zip
--- Comment #6 from Török Edwin edwin+winebugs@etorok.net 2012-09-10 00:53:29 CDT --- (In reply to comment #5)
The URL went 404, is there any other download link available? Is this still an issue in wine 1.5.12?
Updated the URL. It is still an issue with wine-1.5.12-157-gbdf9a9f.
http://bugs.winehq.org/show_bug.cgi?id=30699
--- Comment #7 from Török Edwin edwin+winebugs@etorok.net 2012-09-10 00:54:17 CDT --- Created attachment 41629 --> http://bugs.winehq.org/attachment.cgi?id=41629 ordine.txt
The instructions in my original post on how to create ordine.txt with cat is wrong because bugzilla broke up the lines. So I attached the file here.
http://bugs.winehq.org/show_bug.cgi?id=30699
--- Comment #8 from Bruno Jesus 00cpxxx@gmail.com 2012-09-10 02:13:05 CDT --- This solves the issue to me: winetricks native_oleaut32
Does it work for you too?
http://bugs.winehq.org/show_bug.cgi?id=30699
--- Comment #9 from Török Edwin edwin+winebugs@etorok.net 2012-09-10 02:53:59 CDT --- (In reply to comment #8)
This solves the issue to me: winetricks native_oleaut32
Does it work for you too?
No, but I only have the wine provided oleaut32.dll. Should I copy a real oleaut32.dll from somewhere?
http://bugs.winehq.org/show_bug.cgi?id=30699
--- Comment #10 from Török Edwin edwin+winebugs@etorok.net 2012-09-10 03:04:21 CDT --- (In reply to comment #9)
(In reply to comment #8)
This solves the issue to me: winetricks native_oleaut32
Does it work for you too?
No, but I only have the wine provided oleaut32.dll. Should I copy a real oleaut32.dll from somewhere?
OK, downloaded an oleaut32.dll 5.1.2600.2180, set it to native, and it works.
Thanks a lot for the hint!
I'd keep this bug open though, cause it doesn't work with only wine / winetricks provided stuff, and this application doesn't ship its own oleaut32.dll.
http://bugs.winehq.org/show_bug.cgi?id=30699
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Component|wineps.drv |oleaut32 Ever Confirmed|0 |1
--- Comment #11 from Bruno Jesus 00cpxxx@gmail.com 2012-09-10 03:09:51 CDT --- This bug may be related to or may be a dupe of bug 14218, it will need further investigation though.
https://bugs.winehq.org/show_bug.cgi?id=30699
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Abandoned?
--- Comment #12 from Ken Sharp imwellcushtymelike@gmail.com --- Is this still an issue in Wine 1.7.45 or later?
https://bugs.winehq.org/show_bug.cgi?id=30699
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |damjan.jov@gmail.com Keywords|Abandoned? |
--- Comment #13 from Damjan Jovanovic damjan.jov@gmail.com --- Still an issue on Wine 5.14.
To reproduce: Set up cups and cups-pdf, create a PDF printer, ensure it works. Download the ZIP in the "URL" field. Extract it and install to your WINEPREFIX. export LANG=ro_RO.UTF-8 LANGUAGE=ro_RO.UTF-8 LC_TIME=ro_RO.UTF-8 cd "${WINEPREFIX}/drive_c/Program Files/OPFV 2012" Populate ordine.txt with the data in https://bugs.winehq.org/attachment.cgi?id=41629 wine OPFV_2012.exe Select the only entry in the only dropdown menu. Click the bottom right button "Incarcare". In the new screen, type "a" into the "Adresa" field. In the very thin field just under it, with "Cod iban platitor" on the left, type 40. In the bottom field, "Reprezentat", type "a". Click the green "Listare" button on the right. The resulting PDF should be wherever you set up cups-pdf to write them to. No need to edit win.ini like the OP said.
Debugging this is long and hard, but in essence, the OLEPictureImpl_Render() function (our implementation of COM's IPicture::Render()) is called 3 times. On the first call, the IPicture is the main window background, and it is drawn on the main window. In the second and third calls, the IPicture is the barcode.
For the first and second calls, the DC type is OBJ_DC and TECHNOLOGY is DT_RASDISPLAY. For the third call the DC type is OBJ_METADC and TECHNOLOGY is DT_METAFILE.
If OLEPictureImpl_Render() is made to do nothing, the main window background changes color as expected, but there is a difference in the output PDF that reveals something interesting. When nothing is drawn, the barcode area is completely white. When we do draw, there is very tiny spec in the middle left, and if you zoom in 400%, you do see a very tiny barcode. [Note that this is true as of 5.14 - the OP's PDF made with the older Wine version lacks the barcode completely.]
In other words, this is some kind of picture positioning/scaling issue when rendering to a metafile.