× 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.



The advice I follow for my own work with Java and RPG is this: Always
write a working example in Java, then implement that in RPG.

I don't use this API, so I had to look it up.
The PDF Reference cited in the iText 5 API is PDF 1.7:
https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdf_reference_archive/pdf_reference_1-7.pdf

There, on page 580, the valid values for Duplex are
Simplex
DuplexFlipShortEdge
DuplexFlipLongEdge

I note that the documentation has these in camel case, but the RPG
definitions are upper case. That's the place I would start.
--buck

On Mon, 5 Oct 2020 at 05:23, Merlino, Basilio (NissanContractor)
<b.merlino-extern@xxxxxxxxx> wrote:

Dear All,

I' m using itext 5.5.13.2 api (https://api.itextpdf.com/iText5/java/5.5.13.2/) to manipulate pdf. I need to set the duplex print option with shortedge flip .

My rpg code is the following. No error is generated but the pdf still remain as simplex. Can someone help me to identify if there is an error in the rpg code

Thank you very much for your help

Basilio


D pdfName_DUPLEXFLIPSHORTEDGE...
D C 'DUPLEXFLIPSHORTEDGE'
D pdfName_DUPLEX...
D C 'DUPLEX'

D ITX5PdfName S O CLASS(*JAVA
D :'com.itextpdf.text.pdf.PdfName')

D ITX5PdfObject S O CLASS(*JAVA
D :'com.itextpdf.text.pdf.PdfObject')


D ITX5_addViewerPreference...
D PR
D ExtProc(*JAVA:
D 'com.itextpdf.text.pdf.PdfWriter':
D 'addViewerPreference')
D pdfNameKey like(ITX5PdfName)
D pdfNameValue like(ITX5PdfObject)

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* new_ITX5PdfName()
* Create a new Ppf Name
*
* Returns the new Pdf Name
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D new_ITX5PdfName...
D PR like(ITX5PdfName)
D ExtProc(*JAVA:
D 'com.itextpdf.text.pdf.PdfName':
D *CONSTRUCTOR)
d testo like(jstring)

Dcl-s pdfNameDuplex like(ITX5PdfName);
Dcl-s pdfNameShortEdge like(ITX5PdfName);
Dcl-s shortedge like(jstring);
Dcl-s duplex like(jstring);

shortedge = new_String(pdfName_DUPLEXFLIPSHORTEDGE);
pdfNameshortedge = new_ITX5PdfName(shortedge);
duplex = new_String(pdfName_DUPLEX);
pdfNameduplex = new_ITX5PdfName(duplex);
ITX5_addViewerPreference(writer:duplex:shortedge);


***********************************************************************************************************
CONFIDENTIALITY NOTICE

This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information.

If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify us by email to email.security@xxxxxxxxxxxxxxxxx with a copy of this message. You must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message if you are not the intended recipient. NISSAN EUROPE and any of its subsidiaries each reserves the right to monitor all e-mail communications through its networks.

NISSAN EUROPE is neither liable for the proper, complete transmission of the information contained in this communication nor any delay in its receipt. This email was scanned for the presence of computer viruses. In the unfortunate event of infection NISSAN EUROPE does not accept liability.

Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them.

***********************************************************************************************************
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

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.