shioyadan / kuroko-cli

Kuroko-cli is a simple command line tool to convert EMF to PDF. You can download a pre-compiled binary from https://github.com/shioyadan/kuroko-cli/releases.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kuroko-CLI

Kuroko-CLI is a small command line tool to convert from EMF to PDF.

  • It captures EMF data in a clipboard and converts it to PDF.
  • In a similar way as MetafileToEPSConverter makes EPS files, you can make PDF files from pictures on MS Power Point/Excel.
  • Kuroko-CLI can run only on Windows 10, because it relies on "Microsoft Print to PDF" printer.

demo

How to use

You should install a dedicated virtual printer before running Kuroko.

kuroko-cli.exe -i

Capture EMF data in a clipboard and convert it to a PDF file.

kuroko-cli.exe -b PDF_FILE_NAME

Convert an EMF file to a PDF file.

kuroko-cli.exe -c EMF_FILE_NAME [PDF_FILE_NAME]

How to build

  • Install Visual Studio Build Tools 2019 - C++ Build Tools
  • Run this command
    build_shell.bat nmake build_release 
    
  • or
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat
    nmake build_release
    
  • or open it with VSCode and run a build task.

Known issues

  • Transparent objects are not converted correctly.
    • Kuroko currently uses GDI and this issue seems to be due to GDI's limitation.
    • Using GDI+ and ConvertToEmfPlus should solve this issue, but not.
    • If you set USE_GDI_PLUS in kuroko-cli.cpp, GDI+ is enabled.
    • Any suggestions and pull-requests are welcome.
  • A PDF cropping algorithm is extremely unsafe and may be broken in the future when the MS PDF printer is updated.

License

Copyright (C) 2020 Ryota Shioya shioya@ci.i.u-tokyo.ac.jp This application is released under the 3-Clause BSD License, see LICENSE.md.

About

Kuroko-cli is a simple command line tool to convert EMF to PDF. You can download a pre-compiled binary from https://github.com/shioyadan/kuroko-cli/releases.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:C++ 92.0%Language:Makefile 4.5%Language:Batchfile 3.5%