pdf2swf couldn't create a font for 'SimSun' - linux

I was trying to convert a pdf into a swf and i was using swftools. To support Chinese, i downloaded xpdf-chinese-simplified.tar and modified the add-to-xpdfrc file like this
#----- begin Chinese Simplified support package (2011-sep-02)
cidToUnicode Adobe-GB1 /usr/local/share/xpdf-chinese-simplified/Adobe-GB1.cidToUnicode
unicodeMap ISO-2022-CN /usr/local/share/xpdf-chinese-simplified/ISO-2022-CN.unicodeMap
unicodeMap EUC-CN /usr/local/share/xpdf-chinese-simplified/EUC-CN.unicodeMap
unicodeMap GBK /usr/local/share/xpdf-chinese-simplified/GBK.unicodeMap
cMapDir Adobe-GB1 /usr/local/share/xpdf-chinese-simplified/CMap
toUnicodeDir /usr/local/share/xpdf-chinese-simplified/CMap
#fontFileCC Adobe-GB1 /usr/..../gkai00mp.ttf
displayCIDFontTT Adobe-GB1 /usr/local/share/xpdf-chinese-simplified/gkai00mp.ttf
#----- end Chinese Simplified support package
When i tried to convert the pdf,
/usr/local/bin/pdf2swf 10434_102_demo_1414995035745.pdf -o test.swf -s
languagedir=/usr/local/share/xpdf-chinese-simplified
an error occured:
Error: Couldn't create a font for 'SimSun'
PS. I have two environments, one is MAC and the other is Redhat, everything is ok in MAC and this error only occurs in Redhat.

As this question is missing an answer, I can add an optional solution (as a workaround) here.
For Flexpaper, if you use the "HTML5" render mode, it will render Chinese, and other unicode text, correctly.

Related

Linux pipe to text file shows unwanted special characters in text editor

my
symfony help >> ./symfonyBinConsole2copyQ.sh;
looks encrypted for me.
result looks in Kate editor like so:
[32mSymfony CLI[39m version [33mv4.25.4[39m (c) 2017-2021 Symfony SAS
...
expected the same formation like i know it from terminal:
Symfony CLI version v4.25.4 (c) 2017-2021 Symfony SAS
...
source i readet:
-https://stackoverflow.com/questions/41428967/linux-pipe-mysql-cli-show-variables-to-text-file
Pitest: How to redirect the log output to a file?
Various console apps either default to showing with Ansi terminal codes, or without. The Symfony console command has a --no-ansi option to turn it off.
An issue at https://github.com/symfony/cli/issues/222 also suggested the env var NO_COLOR, which does also work.
NO_COLOR=1 symfony list

YOLO Error: names: Using default 'data/names.list' Couldn't open file: data/names.list when implemented on CPU offline

I have implemented custom object detector using YOLO for offline on CPU.
When I run this command on CPU:
!./darknet detector demo data/obj.data cfg/yolov4-obj.cfg yolov4-obj_final.weights -dont_show MVI_1615_VIS.avi -i 0 -out_filename results.avi
I get the following error:
GPU isn't used
OpenCV version: 3.2.0
names: Using default 'data/names.list'
Couldn't open file: data/names.list
Kindly help.
I came across this error recently. For me, it was a simple mistake in the obj.data file.
Instead of the correct version which is:
names = obj.names
I had:
names - obj.names
Hence why it couldnt find the obj.names file
Make sure there aren't any errors in the obj.data file. For more info, check out: https://github.com/AlexeyAB/darknet#how-to-train-to-detect-your-custom-objects

Not able to read file in Pypandoc

I am trying to covert a pdf to html using Pandoc. I have installed pandoc binary , added the environment variable path and then using
import pypandoc
import os
os.environ.setdefault('PYPANDOC_PANDOC', 'C://Program Files//Pandoc//pandoc.exe')
file_path = r"D:/46580375_1593783098922.pdf"
output = pypandoc.convert_file("46580375_1593783098922.pdf", to='html', outputfile= 'test.html')
It is giving me an error :
RuntimeError: Invalid input format! Got "pdf" but expected one of
these: commonmark, creole, csv, docbook, docx, dokuwiki, epub, fb2,
gfm, haddock, html, ipynb, jats, jira, json, latex, man, markdown,
markdown_github, markdown_mmd, markdown_phpextra, markdown_strict,
mediawiki, muse, native, odt, opml, org, rst, t2t, textile, tikiwiki,
twiki, vimwiki
What am I missing?
As the error said, you can't convert PDF to HTML via pandoc.

Win10: ASDF can't load system (ASDF_OUTPUT_TRANSLATION error)

Update 2
I think #faré is right, it's an output translation problem.
So I declared the evironment variable ASDF_OUTPUT_TRANSLATIONS and set it to E:/. Now (asdf:require-system "my-system") yields a different error: Uneven number of components in source to destination mapping: "E:/" which led me to this SO-topic.
Unfortunately, his solution doesn't work for me. So I tried the other answer and set ASDF_OUTPUT_TRANSLATIONS to (:output-translations (t "E:/")). Now I get yet another error:
Invalid source registry (:OUTPUT-TRANSLATIONS (T "E:/")).
One and only one of
:INHERIT-CONFIGURATION or
:IGNORE-INHERITED-CONFIGURATION
is required.
(will be skipped)
Original Posting
I have a simple system definition but can't get ASDF to load it.
(asdf-version 3.1.5, sbcl 1.3.12 (upgraded to 1.3.18 AMD64), slime 2.19, Windows 10)
What I have tried so far
Following the ASDF manual: "4.1 Configuring ASDF to find your systems"
There it says:
For Windows users, and starting with ASDF 3.1.5, start from your
%LOCALAPPDATA%, which is usually ~/AppData/Local/ (but you can ask in
a CMD.EXE terminal echo %LOCALAPPDATA% to make sure) and underneath
create a subpath config/common-lisp/source-registry.conf.d/
That's exactly what I did:
Echoing %LOCALAPPDATA% which evaluates to C:\Users\my-username\AppData\Local
Underneath I created the subfolders config\common-lisp\source-registry.conf.d\ (In total: C:\Users\my-username\AppData\Local\config\common-lisp\source-registry.conf.d\
The manual continues:
there create a file with any name of your choice but with the type conf, for instance 50-luser-lisp.conf; in this file, add the following line to tell ASDF to recursively scan all the subdirectories under /home/luser/lisp/ for .asd files: (:tree "/home/luser/lisp/")
That’s enough. You may replace /home/luser/lisp/ by wherever you want to install your source code.
In the source-registry.conf.d folder I created the file my.conf and put in it (:tree "C:/Users/my-username/my-systems/"). This folder contains a my-system.asd.
And here comes the weird part:
If I now type (asdf:require-system "my-system") in the REPL I get the following error:
Can't create directory C:\Users\my-username\AppData\Local\common-lisp\sbcl-1.3.12-win-x86\C\Users\my-username\my-systems\C:\
So the problem is not that ASDF doesn't find the file, it does -- but (whatever the reason) it tries to create a really weird subfolder hierarchy which ultimately fails because at the end it tries to create the folder C: but Windows doesn't allow foldernames containing a colon.
Another approach: (push path asdf:*central-registry*)
If I try
> (push #P"C:/Users/my-username/my-systems/" asdf:*central-registry*)
(#P"C:/Users/my-username/my-systems/"
#P"C:/Users/my-username/AppData/Roaming/quicklisp/quicklisp/")
> (asdf:require-system "my-system")
I get the exact same error.
I don't know what to do.
Update
Because of the nature of the weird path ASDF was trying to create I thought maybe I could bypass the problem by specifying a relative path instead of an absolute one.
So I tried
  (:tree "\\Users\\my-username\\my-systems")
in my conf file. Still the same error.
Ahem. It looks like an output-translations problem.
I don't have a Windows machine right now, but this all used to work last time I tried.
Can you setup some ad hoc output-translations for now that will make it work?

How does webkit find libflashplayer.so?

I use webview in webkitgtk to open a html file to play flash files on server in my code. But it suggest me that Missing Plug-in. So I want to know how webkit finds libflashplayer.so and what should I do?
The plugin search path on Unix systems is defined in the WebKit source code at WebKit/Source/WebKit2/Shared/Plugins/unix/PluginSearchPath.cpp. Currently it loads plugins from the following locations:
$MOZ_PLUGIN_PATH
$MOZILLA_HOME/plugins
$HOME/.mozilla/plugins
$HOME/.netscape/plugins
/usr/lib/browser/plugins
/usr/local/lib/mozilla/plugins
/usr/lib/firefox/plugins
/usr/lib64/browser-plugins
/usr/lib/browser-plugins
/usr/lib/mozilla/plugins
/usr/local/netscape/plugins
/opt/mozilla/plugins
/opt/mozilla/lib/plugins
/opt/netscape/plugins
/opt/netscape/communicator/plugins
/usr/lib/netscape/plugins
/usr/lib/netscape/plugins-libc5
/usr/lib/netscape/plugins-libc6
/usr/lib64/netscape/plugins
/usr/lib64/mozilla/plugins
/usr/lib/nsbrowser/plugins
/usr/lib64/nsbrowser/plugins
So WebKitGTK+ will find libflashplayer.so if it is installed to one of those locations.
It is in /usr/lib/flashplugin-installer
fullt path:
/usr/lib/flashplugin-installer/libflashplayer.so

Resources