ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CPYSPLF to PDF: wrong characters issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CPYSPLF to PDF: wrong characters issue

    Hi all,
    I’m trying to convert (in V7R2M0) a spool file contains Greek characters to PDF, but I can’t see correct Greeks.
    CPYSPLF FILE(BIL522EC) TOFILE(*TOSTMF) JOB(483247/XXPGMKH/QPRTJOB)
    SPLNBR(*LAST) CTLCHAR(*FCFC) TOSTMF('/HOME/TEST3.PDF') WSCST(*PDF)

    The produced STMF has CCSID 65535
    The Greek CCSID is 875.
    I have tried unsuccessfully to change the CCSID converting it from 37 to 875
    STRQSH CMD('iconv -f 37 -t 500 /home/TEST3.PDF > /home/TEST3CONV.PDF')
    Also I've tried all conversion combinations between 37, 1208, 819, 423 and 500 but without success.

    Could someone help please?

    I would like to comment that the conversion of the same spool file (SCS) to ascii text in terms of Greek characters works fine.
    The produced STMF has CCSID 500 and I convert successfully the CCSID from 500 to 875
    CPYSPLF FILE(BIL522EC) TOFILE(*TOSTMF) JOB(483247/XXPGMKH/QPRTJOB) SPLNBR
    (*LAST) TOSTMF('/HOME/TEST3.txt') WSCST(*NONE)

    STRQSH CMD('iconv -f 500 -t 37 /home/TEST3.txt > /home/TESTCONV.txt')

  • #2
    A PDF is not a text file. Some of the bytes inside the file contain text, but others contain binary data. If you run it through iconv to convert between character sets, you will corrupt the file.

    Don't worry about the CCSID of the PDF file. PDF readers do not use CCSIDs.

    Also, don't create it with the wrong characters and then try to convert them afterwards (which is what you're showing in your example.)

    Instead, make sure you're generating it with the right characters to begin with. And then transfer it using a binary-safe method to your PC for viewing.

    Comment


    • kyriakos Chasapis
      kyriakos Chasapis commented
      Editing a comment
      Thank you Scott,
      You mean that the stream file has been initially created wrongly through CPYSPLF?

    • Scott Klement
      Scott Klement commented
      Editing a comment
      Yes. The content in the PDF is generated incorrectly, perhaps due to bad settings? or a bad spooled file?

  • #3
    Dear all,
    The issue with Greeks eventually solved, when IBM installed the licensed program 5733B45- AFP Font Collection.

    Thanks

    Comment


    • #4
      Thanks for the update.

      I must admit that I'd forgotten about your issue with everything going on...October seems like it was a long, long time ago.

      Cheers,

      Emmanuel

      Comment

      Working...
      X