RT#7802: Bug: Convert JP text file to PDF errors

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

User avatar
rakunavi
User
Posts: 2258
Joined: Sat Sep 11, 2021 5:04 am

RT#7802: Bug: Convert JP text file to PDF errors

Post by rakunavi »

Hello all,

I have noticed that character corruption occurs when converting Japanese text files with JIS (ISO-2022-JP) encoding via the "Convert Text Files to PDF" dialog, even when "Japanese (JIS)" is selected in the "Text Encoding" options.

  • figure1.png
I have attached a video demonstrating this behavior, comparing the conversion process between PDF-XChange Editor and Adobe Acrobat X using the same sample text file. The attached image highlights the corrupted parts with yellow markers.

  • figure2.png
  • SampleFiles1.zip

  • Video1.webm

During my investigation, I noticed certain patterns in how the corruption occurs. Specifically, I generated 350 text files using the following AutoHotkey v1 script:

Code: Select all

Loop 350 {
	count := A_Index
	Loop 6 {
		if (A_Index == 1) {
			paragraph := ""
			Loop, % count
				paragraph .= "あ"
			output := paragraph
		} else
			output .= "`n`n" . paragraph
	}
	FileAppend, %output%, %count%.txt
}
To put it in words, the key points for generating text files are as follows:
  1. Each text file consists of 6 paragraphs.
  2. Each paragraph consists of the Hiragana character "あ" (JIS code: 0x2422), with the character count increasing by one for each file.
  3. Paragraphs are separated by a blank line.
  4. The encoding is Japanese JIS (ISO-2022-JP) with LF line endings.
  • count8.png
  • SampleFiles2.zip

  • Video2.webm
Observed Symptoms:

  1. Within the paragraphs, each character あ (JIS code: 0x2422) is incorrectly rendered as the string $". This results in long sequences of corruption such as $"$"$"$".
    • The specific corruption string ←(B (likely related to the ESC (B escape sequence) appears at the very end of the text.
      • Notably, this ←(B corruption only occurs when the text file ends without a trailing newline (e.g., ...あ[EOF]). If the file ends with a newline (e.g., ...あ[LF][EOF]), this specific trailing corruption does not occur.
        • On pages 1 through 81, as well as on specific pages (pages 124 and 252), no character corruption occurs at all within the paragraphs.
        I hope these specific patterns provide the developers with a clue to identifying the root cause.

        Hoping that the above information will be of some help to you.
        Thank you so much for your continued support.

        Best regards,
        rakunavi

        - PDF-XChange Editor PRO Version: 10.8.4 build 409
        - OS Version: Windows 11 Pro / Home 25H2 Build 26200.8037
        - Adobe Acrobat X Standard Version 10.1.16
        - PC Model: GMKtec Nucbox M7 Pro with HUION Kamvas Pro 19 / Lenovo IdeaPad C340-15IWL

        [EDIT] Since a ticket has been officially issued for this request, I have changed the topic title as follows. 2026-3-27 6:07 JST (UTC+9)
        • Previous Title: Character corruption when converting Japanese JIS (ISO-2022-JP) text files to PDF
        • New Title: RT#7802: Bug: Convert JP text file to PDF errors
        You do not have the required permissions to view the files attached to this post.
        Last edited by rakunavi on Thu Mar 26, 2026 9:07 pm, edited 1 time in total.
        Top needs for PDFXCE
        forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
        forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
        forum.pdf-xchange.com/viewtopic.php?t=37353 FullScrnMultiMon
        forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
        User avatar
        Daniel - PDF-XChange
        Site Admin
        Posts: 13222
        Joined: Wed Jan 03, 2018 6:52 pm

        Re: Character corruption when converting Japanese JIS (ISO-2022-JP) text files to PDF

        Post by Daniel - PDF-XChange »

        Hello, rakunavi

        Thank you for the detailed report. I have reproduced the issue and raised this with the Dev team for review and hopefully, resolution.

        RT#7802: Bug: Convert JP text file to PDF errors

        Kind regards,
        Dan McIntyre - Support Technician
        PDF-XChange Co. LTD

        +++++++++++++++++++++++++++++++++++
        Our Web site domain and email address has changed as of 26/10/2023.
        https://www.pdf-xchange.com
        [email protected]
        User avatar
        rakunavi
        User
        Posts: 2258
        Joined: Sat Sep 11, 2021 5:04 am

        Re: RT#7802: Bug: Convert JP text file to PDF errors

        Post by rakunavi »

        Thank you, Daniel, for creating the ticket. I really appreciate you taking the time out of your busy schedule.

        By the way, if you convert a Japanese text file encoded in Japanese EUC to PDF, a blank PDF file containing no objects at all is generated.

        • Animation.gif
        • SampleFile.zip
        This is exactly the same behavior reported in the following topic just the other day. I am providing this additional report for your reference.

        Please give my best regards to developers.

        Best regards,
        rakunavi

        - PDF-XChange Editor PRO Version: 10.8.4 build 409
        - OS Version: Windows 11 Pro / Home 25H2 Build 26200.8037
        - PC Model: GMKtec Nucbox M7 Pro with HUION Kamvas Pro 19 / Lenovo IdeaPad C340-15IWL
        You do not have the required permissions to view the files attached to this post.
        Top needs for PDFXCE
        forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
        forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
        forum.pdf-xchange.com/viewtopic.php?t=37353 FullScrnMultiMon
        forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
        User avatar
        Daniel - PDF-XChange
        Site Admin
        Posts: 13222
        Joined: Wed Jan 03, 2018 6:52 pm

        Re: RT#7802: Bug: Convert JP text file to PDF errors

        Post by Daniel - PDF-XChange »

        Hello, rakunavi

        Yes, that one was also discussed at the same time. In my testing I stumbled on it just by leaving the encoding on Japanese "Auto". The Dev team is aware and working on that as well.

        Kind regards,
        Dan McIntyre - Support Technician
        PDF-XChange Co. LTD

        +++++++++++++++++++++++++++++++++++
        Our Web site domain and email address has changed as of 26/10/2023.
        https://www.pdf-xchange.com
        [email protected]