× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Paul,

The printer wouldn't print the AFPRSC image. The OUTQ is linked to a
printer. HPT is enabled. Along with ...
Image configuration . . . . . . . : *IMGA01 on the device
description.

On Thu, Jan 14, 2016 at 10:56 AM, Paul Roy <paul.roy@xxxxxxx> wrote:

Hello,

from my understanding, there is no transformation. I guess the printer is
PDF capable. the API makes no transformation, but just put the pdf file
as a spooled file in the outq.
I wonder if there is not some confusion in this thread. In this case It
worked "by accident"...

When you have an AFP spooled file, you can print it on most standard PCL
printers just using HPT (Host Print Transform) with right customization...
WSCST object

so I would suggest

STEP 6: (not needed if your printerfile is created with adhoc parameters/
and assuming you do not need the pdf file).
OVRPRTF TESTUPS DEVTYPE(*AFPDS) OUTQ(QPRINTS) PAGESIZE(66 85)
STEP 7 run your program
... done

If the outq is linked to a printer, HPT should do the rest for you and you
will get your paper printed...

Paul




From: Michael Schutte <mschutte369@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 14/01/2016 15:53
Subject: Re: Printing GIF with AFPDS printer file.
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



My PDF on the IFS was created from a printer file that was afpds. The
qsysprt file created from the Api was userascii

You more information than me. Haha. I never messed or looked at any exit
points. I will take a look later when I get back

Sent from my iPhone

On Jan 14, 2016, at 2:40 AM, Jan Grove Vejlstrup <jgv@xxxxxxxx> wrote:

Hello Michael

Thank you very much for your interesting information.

After 7) you have a PDF-file in the IFS, that you convert to AFPDS using
QimgCvtImg. According to the documentation is a PDF-file allowed as input,
if you have registered a transform exit program:

/25//PDF (Portable Document Format) (Available only if a transform exit
program that supports PDF input has been registered to the
QIBM_QIMG_TRANSFORMS exit point)

/ I'm interested in this program. Can you please inform me about this
program?

Best regards

Jan


Am 13.01.2016 um 22:36 schrieb Michael Schutte:
Good news. After getting the QimgCvtImg api to work using a stream
file. I
thought I may be out of luck. But I was able to successfully get what
I
needed.

During this process, I read up on the AFPRSC printer file keyword. I
first
started out using that. The problem was that the printers wouldn't
print
the image that I've put on the spool file. I was expecting it work
basically like and image.

Since it wouldn't print from the original AFPDS spool file, I tried to
override the printer file so that it would create a PDF on the IFS.
When I
opened the PDF or printed, the image was there. So great I was almost
there.

After that I fought for several days with trying to get the GIF image
on a
printer file (QSYSPRT) overridden to DEVTYPE(*USERACSII). I was able
to
successfully get the image to print, but I had no control on where it
printer, nor the size of it.

Then it hit me this morning. The QimgCvtImg api is able to convert PDF
stream files to a spool file. So I gave it shot and was able to get my
packing slip exactly how I need it.

The steps needed for others in the future when getting a base64 encoded
image from a webservice.

1. Get the GIF from UPS by initiating the call to the webservice.
2. parse the base64 string from the XML data (or whatever datasource) .
3. Use Apr_Base64_Decode_Binary (apache's base64 program).
-- binary_length =
Apr_Base64_Decode_Binary(binaryImage:LabelImage);
//LabelImage is base64, the input parm. binaryImage is the output
converted string.
4. Converted the Source CCSID of 1208 to 500 using QtqIconvOpen, iconv,
iconv_close procedures.
5. Wrote the binary string field to the IFS using Scott Klements IFS
procedures.
fd = open('/home/xxxxxxxxxx/testups.gif'
: O_WRONLY + O_CREAT + O_TRUNC
: S_IRUSR + S_IWUSR + S_IRGRP);
callp write(fd: %addr(binaryimage): %len(%Trim(binaryimage)));
callp close(fd);
6. Override packing slip printer file.
OVRPRTF TESTUPS DEVTYPE(*AFPDS) OUTQ(QPRINTS) PAGESIZE(66 85)
TOSTMF(''/home/xxxxxxxxxx/test1.pdf'') WSCST(*PDF)');
7. Opened printer file for packing slip. Add information to print, and
set
image in proper place using program to system fields.
Rotate = 0;
// How far down the page.
POSD = 6.5;
// How far across the page
POSA = 1.25;
// Width of the image
WIDTH = 8;
// Height of the image
HEIGHT = 4;
// Name of Object on IFS. WITHOUT THE PATH
OBJNAME = testups.gif;
// Path to the Object
PATH = '/home/xxxxxxxxxx/';
Write REC1; // Put image on page.
7.A. The REC1 definition.
A R REC1 AFPRSC(&OBJNAME 22 +
A &POSD &POSA +
A (*SIZE &WIDTH &HEIGHT) +
A (*ROTATION &ROTATE) +
A (*MAPOPT *SL) +
A (*PATH &PATH) +
A )
A ROTATE 3S 0P
A POSD 5S 3P
A POSA 5S 3P
A WIDTH 5S 3P
A HEIGHT 5S 3P
A OBJNAME 125A P
A PATH 500A P

8. Override QSYSPRT as device type of *USERASCII
OVRPRTF QSYSPRT DEVTYPE(*USERASCII) // there is no opening of this
file. QimgCvtImg will create it.
9. Call QimgCvtImg after setting up the datastructures to pass to it.
Code
example found here. http://code.midrange.com/0452359861.html
10. Delete override on both printer files.
11. Printer file created in QimgCvtImg prints with image on it!!!!!



On Tue, Jan 12, 2016 at 1:21 PM, Michael Schutte
<mschutte369@xxxxxxxxx>
wrote:

So I was able to get the QIMGCVTI/QimgCvtImg api to work. However, I
don't think this is what I need. Because I don't see how I can get
the
image to the printer file in the position I need it and the
orientation
needed.

Here is the code I was able to get working in case someone else needs
it.

http://code.midrange.com/0452359861.html

On Mon, Jan 11, 2016 at 11:54 AM, Michael Schutte
<mschutte369@xxxxxxxxx>
wrote:

I am amazed by the lack of examples using the QIMGCVTI, QimgCvtImg
APIs.

A lot of people asking for examples, but not getting any answers. I'm
going to give a shot and see what happens. I'm not completely sure
what
needs to go into the data structures. So I'll see how it goes. Ask
questions as I go. Sorry!


On Mon, Jan 11, 2016 at 10:26 AM, Wilson, Jonathan <
piercing_male@xxxxxxxxxxx> wrote:

On Mon, 2016-01-11 at 09:58 -0500, Michael Schutte wrote:
Now that I think about it, I believe I found that before the last
time
I
tried this project.

I changed it to 22 and it still prints the image. But it only does
it
if I
override the printer file to *PDF and to the IFS. Which requires me
to
then
open in Adobe and print.

This would be a problem for us as the account will be printing a
batch
of
these, usually more than 100.

Obviously, I could run a windows command to print. But that seems
troublesome and I don't believe that would work in a submitted job.
I
say
don't believe because I've never tried and a submitted job;
wouldn't
have a
terminal to a pc.
It probably wouldn't print as you say, because there wouldn't be
windows
attached. That said, I wonder if it would be possible to print via
qsh
(or similar) by using a *nix pdf print program or more directly
calling
a java one? Obviously that would depend on getting the source,
and/or a
successful compile in the *nix environment or java language (both of
which I have no experience with in the IBM/i world).


Anyway, is there any way I could get this to print from a spool
file
much
like a page segment or overlay?

From what I've seen we need to have InfoPrint Server or something
like
that. How can I tell if we have that?

Or can I take the base64 string and create an overlay/page segment?

We are printing to an HP printer. I test using HP OfficeJet Pro
X476
dnMFP
Production printer will be HP LaserJet 4350dtn

I tried using Scott's PRTSTMF, but it's cutting off the last inch
of
the
page and telling the printer that I need to put legal paper in. I
don't
know why.

On Mon, Jan 11, 2016 at 8:50 AM, Charles Wilt
<charles.wilt@xxxxxxxxx>
wrote:

That's the way I read it...

Strange that they don't have a symbolic constant for GIF.

Charles

On Fri, Jan 8, 2016 at 6:03 PM, John Yeung <
gallium.arsenide@xxxxxxxxx>
wrote:

On Fri, Jan 8, 2016 at 5:31 PM, Charles Wilt <
charles.wilt@xxxxxxxxx>
wrote:
R REC1 AFPRSC('TEST.GIF' 22 2.0 1.0 +
(*SIZE 4 4) (*MAPOPT *SL))
That is indeed interesting. Am I reading it right that the image
type
there is 22, and not some symbolic constant?

John Y.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.