Seeking your thoughts

Seeking your thoughts

Postby TimStone » Wed Jun 07, 2023 10:49 pm

On invoices we print a watermark. It is a PNG file, and it prints as a background on the center of a page. In most cases, it works fine. While invoices can be printed at any computer, the watermark file is stored in the program data directory on the server, so all computers use the exact same image.

One client has an interesting problem. If the office manager prints an invoice, to any printer, it comes out perfectly. If he prints from his computer, to the same printers, the background shows up very dark and overrides the printed text and the graphic.

I suspect it is some setting on his computer but I don't know what. I've eliminated print drivers because I had him remove the printers from Printers & Devices in Windows, and then reinstall them. There was no change. It's not the bitmap because the exact same one is used from both computers, and it works perfectly on one, but not the other. It's the exact same printer class function ( same program, installed on each computer as a client workstation ).

Code: Select all  Expand view

        oPrn:PrintImage( 21 * nRsp, nCsp*2, ( cPath + "wtrmk.png" ), nCsp * 84, 24 * nRsp, , 50, .t. )
 


Your thoughts are appreciated.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Seeking your thoughts

Postby paquitohm » Thu Jun 08, 2023 3:54 pm

Hi,

Try it with a lighter .png file. A very small png file, only for testing purposes only for the purpose of knowing if the problem is the png or what it is

Regards
paquitohm
 
Posts: 262
Joined: Fri Jan 14, 2022 8:37 am

Re: Seeking your thoughts

Postby TimStone » Thu Jun 08, 2023 4:04 pm

The png is small. Since these are used as watermarks, they are transparent and very light.

As I noted, it works fine from one computer but not the other one. The exact same .png file is used from both computers. That .png resides on the server, so I"m not talking about two files, but only one.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Seeking your thoughts

Postby Otto » Thu Jun 08, 2023 4:38 pm

Hello Tim,
Are you using the same printer?

Is it a network printer?

The same printer driver.

If not, maybe one of the colors is empty?

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: Seeking your thoughts

Postby karinha » Thu Jun 08, 2023 4:41 pm

Code: Select all  Expand view

// C:\FWH..\SAMPLES\PRNIMAG1.PRG

#include "FiveWin.ch"
#include "Image.ch"

FUNCTION Main()

   LOCAL oDlg, oImage, lSetAlpha := .T., cTitle, oFont

   // SetAlpha( .f. )

   SkinButtons()

   cTitle := FWDESCRIPTION + ": .JPG, .JIF, .GIF, .BMP, .DIB, .RLE, .TGA, .PNG."

   DEFINE FONT oFont  NAME "Ms Sans Serif"  SIZE 00, -12 BOLD

   DEFINE DIALOG oDlg FROM 0, 0 TO 22, 60 TITLE cTitle ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT FONT oFont

   oDlg:lHelpIcon := .F.

   @ 0, 0 IMAGE oImage SIZE 150, 150 OF oDlg SCROLL // ADJUST

   oImage:Progress( .F. )

   @ 1, 28 BUTTON "Select Image" SIZE 50, 10  ;
      OF oDlg ACTION GetImage( oImage )

   @ 2, 28 BUTTON "Print" SIZE 50, 10 OF oDlg ;
      ACTION PrintImage( oImage )

   @ 3, 28 BUTTON "Copy" SIZE 50, 10 OF oDlg  ;
      ACTION oImage:CopyToClipboard()

   @ 4, 28 BUTTON "Paste" SIZE 50, 10 OF oDlg ;
      ACTION ( oImage:LoadFromClipboard(), oImage:Refresh() )

   @ 5, 28 BUTTON "Save" SIZE 50, 10 OF oDlg  ;
      ACTION ( oImage:SaveImage( "SAVED.JPG", 2, 25 ), ;
               MsgInfo( "saved as saved.jpg" ) )

   @ 6, 28 BUTTON "Exit" SIZE 50, 10 OF oDlg ACTION( oDlg:End() ) CANCEL

   @ 10, 23 CHECKBOX oImage:lStretch PROMPT "Stretch" SIZE 50, 10 OF oDlg ;
      ON CHANGE ( oImage:ScrollAdjust(), oImage:Refresh() )

   @ 11, 23 CHECKBOX lSetAlpha PROMPT "Set Alpha Channel" SIZE 90, 10 OF oDlg ;
      ON CHANGE ( SetAlpha( lSetAlpha ), oImage:Refresh() )

   ACTIVATE DIALOG oDlg CENTERED

   oFont:End()

RETURN NIL

FUNCTION GetImage( oImage )

   LOCAL gcFile := cGetFile( "Bitmap (*.bmp)| *.bmp|" +         ;
                              "DIB   (*.dib)| *.dib|" +         ;
                              "PCX   (*.pcx)| *.pcx|" +         ;
                              "JPEG  (*.jpg)| *.jpg|" +         ;
                              "GIF   (*.gif)| *.gif|" +         ;
                              "TARGA (*.tga)| *.tga|" +         ;
                              "RLE   (*.rle)| *.rle|" +         ;
                              "All Files (*.*)| *.*"            ;
                            , "Please select a image file", 4 )

   IF .NOT. EMPTY( gcFile ) .AND. File( gcFile )

      oImage:LoadBmp( gcFile )

   ENDIF

RETURN NIL

FUNCTION PrintImage( oImage )

   LOCAL oPrn, nRow := 1.00
   LOCAL nLinLogo := 1.00, nColLogo := 600, nLargLogo := 650, nAltLogo := 650

   PRINT oPrn NAME "Image Printing" PREVIEW MODAL

   oPrn:SetPage(9)
   oPrn:SetPortrait()

   PAGE

      /*
      oPrn:PrintImage( 50, 50, oImage )
      */


      /*
      // oPrn:SayImage( nLinLogo, nColLogo, "LOGO.JPG", nLargLogo, nAltLogo )
      */


      @  nLinLogo, nColLogo PRINT TO oPrn IMAGE oImage SIZE nLargLogo, nAltLogo LASTROW nRow

   ENDPAGE

   ENDPRINT

RETURN NIL

// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7805
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Seeking your thoughts

Postby TimStone » Sat Jun 10, 2023 1:06 am

Otto,

The printer is on the network. The .png is on the server. Both computers use the same .png, from the server, and identical copies of the .exe.

I did have them remove the printers from the non-functioning computer, and then re-install them. That did not work.

I AM NOT ABLE TO REPLICATE THE PROBLEM. I am confident it is not in the code. Everywhere else it works perfectly ( all of the other installs, and from all of their workstations ). That is why I'm not posting code ... because it is working on over 50 workstations ... just not this one.

The document has both plain text, and RTF formatted text. It has boxes and grey fill. It supports color. Everything else is working except the watermark. ( .png ), and only on that one computer.

That is why I was hoping for ideas on what, probably in Windows, might need to be checked.

Thank you.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Seeking your thoughts

Postby Otto » Sat Jun 10, 2023 6:19 am

Good morning, Tim,
then the only differences may be the operating system (OS) and the printer driver.

What happens if you print using a PDF printer? Do you see the PNG?

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: Seeking your thoughts

Postby karinha » Sat Jun 10, 2023 2:26 pm

Tim, since you don't want to show the code, can you show the .PNG? Make it available on Mega Upload for testing. Only the machine with problems.

Tim, ya que no quieres mostrar el código, ¿puedes mostrar el .PNG? Ponlo a disposición en Mega Upload para probarlo. Sólo el de la máquina con problemas.

Thanks

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7805
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Seeking your thoughts

Postby TimStone » Mon Jun 12, 2023 5:38 pm

I would like to clarify some points.

1). I have no problem "sharing the code" but that is not the problem. I often share code, and some cases I have share complete classes of code for others to use in their projects. HOWEVER, the code is NOT the problem. It works on every computer except one ... same code and same file.

2) I did not have the file to share. I worked off of the customers concern and a copy of the output. I also do not have a Mega Upload account, or any other suitable for posting screen shots, or files. I do have my own website(s) but that did not seem relevant to my need.

The customer finally sent me the file this morning. Actually, he sent a .bmp file, and it has a grey background rather than transparent. Since the program would not have used that one, I have asked him to go back and send the file actually used. At this point I'm focusing on the graphic file.

I do appreciate the thoughts, but the focus here needed to be on printer controls in Windows, and not FWH code. We can drop this topic for now because I need to see a good .png file first, and make sure the transparency is correct.

What I do know is that the file the client sent me had a grey background. I suspect if I can get the logo onto a transparent background it will be ok.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Seeking your thoughts. UPDATED

Postby TimStone » Tue Jun 13, 2023 11:27 pm

First, I finally obtained the client's .png file. It was using a gray background for transparency ( which at one time could be done ). I had to manually resolve that using an editor I have, and making it true transparent.

The problem continued on his printer, displaying a large dark space where the image was supposed to show.

However, when I looked at the Preview ( printer class ), it was correct. It only occurred on his printer.

We disconnected his printer, and ran it from both machines and it appears to be working as it should.

I have no answers for him on what to do with his printer, but at this point we've isolated it to his computer/printer. He has removed and reinstalled the printer ( drivers ) with no success.

I'll close this issue for now.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Seeking your thoughts

Postby Jimmy » Wed Jun 14, 2023 2:09 am

hi Tim,

have you try to create a "New" User on that PC :idea:

if it work with that "fresh" User than it is the Environment of "old" User which (most) make the Problem
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 99 guests