Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF viewer cannot display CJK characters in PDF generated by ptex/uptex and dvipfmx #285

Closed
fuzy112 opened this issue Oct 3, 2017 · 2 comments

Comments

@fuzy112
Copy link

fuzy112 commented Oct 3, 2017

Description

I tried to compile a Japanese document using ptex2pdf as the tool chain. It compiles successfully.
But the viewer does not display it correctly.

How to reproduce

I tried to compile such a file:

\documentclass{ujarticle}

\begin{document}
    こんにちは、世界。Hello, world.
\end{document}

This is my config:

{
    "latex-workshop.latex.toolchain": [
        {
            "command": "ptex2pdf",
            "args": [
                "-u",
                "-l",
                "-ot",
                "-synctex=1",
                "-ot",
                "-interaction=nonstopmode",
                "%DOC%"
            ]
        }
    ]
}

Expected behavior

Open the output PDF file with Adobe Reader. It displays like this:
adobe

Actual behavior

View it in LaTeXShop:
lts
The Japanese characters are lost.

Log messages

LaTeX Workshop Output
[20:14:06] Initializing LaTeX Workshop.
[20:14:06] Creating LaTeX Workshop http and websocket server.
[20:14:06] LaTeX Workshop initialized.
[20:14:06] Found root file from active editor: c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.tex
[20:14:06] Root file changed from: undefined. Find all dependencies.
[20:14:06] Instatiating new file watcher for c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.tex
[20:14:06] Parsing c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.tex
[20:14:06] Server created on 127.0.0.1:52481
[20:14:06] Default environments loaded
[20:14:06] LaTeX Workshop version: 3.5.4
[20:14:06] Default commands loaded
[20:14:06] Default unimathsymbols loaded
[20:14:12] BUILD command invoked.
[20:14:12] Found root file from active editor: c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.tex
[20:14:12] Root file remains unchanged from: c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.tex.
[20:14:12] Building root file: c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.tex
[20:14:12] Build root file c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.tex
[20:14:12] Toolchain step 1: ptex2pdf, -u,-l,-ot,-synctex=1,-ot,-interaction=nonstopmode,c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document
[20:14:15] LaTeX log parsed with 0 messages.
[20:14:15] Toolchain of length 1 finished.
[20:14:15] Successfully built c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.tex
[20:14:15] No PDF viewer connected for c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.pdf
[20:14:20] TAB command invoked.
[20:14:20] Found root file from active editor: c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.tex
[20:14:20] Root file remains unchanged from: c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.tex.
[20:14:20] No PDF viewer connected for c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.pdf
[20:14:20] Serving PDF file at http://127.0.0.1:52481/viewer.html?file=/pdf:c%3A%5CUsers%5CKirya%5CSource%5CRepos%5CtestLaTeXWorkshop%5Cdocument.pdf
[20:14:20] Open PDF tab for c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.pdf
[20:14:22] Preview PDF file: c:/Users/Kirya/Source/Repos/testLaTeXWorkshop/document.pdf
[20:14:26] Root file remains unchanged from: c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.tex.
Developer Tools Console

Additional Information

I found this error in console.

[Embedded Page] PDF 4d8cd2fcd8884f0b478013b799f4707c [1.5 dvipdfmx (20170318) / TeX output 2017.10.03:2014] (PDF.js: 1.8.609)
2webview.ts:151 [Embedded Page] Warning: Error during font loading: Error: Unable to load binary CMap at: ../web/cmaps/Adobe-Japan1-UCS2.bcmap
2webview.ts:151 [Embedded Page] /pdf:c:\Users\Kirya\Source\Repos\testLaTeXWorkshop\document.pdf
webview.ts:151 [Embedded Page] PDF 2e0229a51252d7487d0d0184bc80e47e [1.5 dvipdfmx (20170318) / TeX output 2017.10.03:2030] (PDF.js: 1.8.609)
2webview.ts:151 [Embedded Page] Warning: Error during font loading: Error: Unable to load binary CMap at: ../web/cmaps/Adobe-Japan1-UCS2.bcmap
@fuzy112 fuzy112 changed the title PDF view cannot display Japanese PDF viewer cannot display CJK characters in PDF generated by ptex/uptex and dvipfmx Oct 3, 2017
@maruta
Copy link
Contributor

maruta commented Oct 3, 2017

#284 will fix this issue.

@James-Yu
Copy link
Owner

James-Yu commented Oct 3, 2017

Hopefully #284 will fix the problem. The update will be released to public channel shortly.

@James-Yu James-Yu closed this as completed Oct 3, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants