Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

oipi image print

Sorry for posting here, but, easiest way for me to include files.

I have a signature that is being converted from base64 to a png file. All good, the image is convereted and correct.
BUT I have a problem printing the .png file using set)printer("BMP..., the image is printed as all BLACK
Here is the code

ApplicantQuoteSignature = SRP_decode(ApplicantQuoteSignatureBase64, "BASE64") Guid=RTI_CreateGUID() guid='bsbstest' SignatureFilename="C:\fm_workarea\":guid:".png" osdelete SignatureFilename oswrite ApplicantQuoteSignature to SignatureFilename Pos=get_printer("POS") EndOfPage=Pos<2> PosForImage=EndOfPage-.5 set_printer("BMP",SignatureFilename,.6:@fm:PosForImage:@fm:6.5:@fm:2.5,0,0)

Attached is the image signature file(bsbstest.png) and a screenshot of the resultant pdf doc.

Observation: (Totally weird.)

File explorer in the RHSide preview shows as all black
Windows image viewer shows as black
Edit with photopad shows image with signature with transparent background.
Edit with msoft paint shows signature with white background.

Any image experts out there that can shed any light on this, or have some advice as to what further I need to do.

Comments

  • I take it that this image is created via a web or mobile application and therefore you don't have an original PNG file you can compare with?
  • edited May 2017
    It is a signature area on a web 'form' that gets sent back as part of the 'form's data
  • I seem to recall experiencing issues with images generated from a web form. I can't recall the details or the resolution. I'm shooting in the dark on this one, but I am wondering if the problem is due to the Base64 string being formatted with CR/LFs. Perhaps your decode process should attempt to accommodate that.
  • Spot on, your my man!!
  • I take it that this fixed your issue?
  • Whoops, take that back, I forgot that I had a test file in there as a .bmp
    If I save the .png that is created, as a .bmp it works
    .png -> Stripping out crlf$ still black printing
  • Are you using OIPI Classic or OIPI.Net? Have you tried the other OIPI to see if you get the same results?

    Also, how are you stripping out the CR/LF characters?
  • Are you using OIPI Classic or OIPI.Net? Have you tried the other OIPI to see if you get the same results?
    OIPI Classic, not tried OIPI.Net (need to see what i need to do to just do for this and not global)
    Also, how are you stripping out the CR/LF characters?
    convert crlf$ to '' in ApplicantQuoteSignatureBase64
  • using imagemagick to strip the transparency works
  • Yes, it is ok using oipi.net but this is ignored as it just prints raw rtf.
    set_printer2("ENABLERTF",1)
    So, definitely steering well clear of oipi.net, always been waring due to issues reported.

  • btw: this is what 'fixed' it

    cmd="magick convert ":SignatureFilename:" -background white -flatten ": SignatureFilename call SRP_Run_Command(CMD)
  • Is this image the only content in the body being sent to the server? What is the Content-Type? If you are using the SRP HTTP Framework for this, can you email me a request log that includes the Base64 content?
  • The base64 is in a field.
    There is nothing wrong with the file.
    Googling shows there are issues with photo viewers displaying images with transparent backgrounds, so oipi has that issue too.
  • You are probably right that nothing is wrong with the file and that the OIPI is one of the utilities that struggles with transparency. However, if the content originates in a web form, the data can be slightly altered based on the way it is packaged up and sent to the server.

    How did the Base64 data get into the field in the first place?
  • the web developer converted the 'canvas' image to base64 and returned it in the field along with other data.
  • ...and returned it in the field along with other data.
    This isn't clear to me what you mean. What is a "field" in this context? JSON? Is this being submitted in a HTTP Framework request?
  • a json field that is related to an oi dict field all using framework
  • ok, dictionary name field
  • and api that he does a POST
  • Sorry, I don't use all the buzzword terminology.

    I am happy it is working, so don't go to any further trouble.

    Thanks for your help
  • Got it. Well, the offer to inspect the request log stands.
  • FWIW, I confirmed the issue you experienced. I also confirmed that OIPI Classic is the problem whereas OIPI.Net works just fine. You said that you wanted to steer clear of OIPI.Net due to reported problems. There are some issues that come up when trying to run reports designed for OIPI Classic within OIPI.Net, but these are mostly formatting related since OIPI.Net renders object a bit differently. There are no showstoppers with OIPI.Net that I am aware of so don't be too afraid to migrate.
  • set_printer2("ENABLERTF",1) , the rtf codes are printed.
  • Ah...now I understand what you were trying to explain earlier. My quick review of the WORKS forum shows that both times you asked about ENABLERTF you've received no response.
Sign In or Register to comment.