How to use WKhtmltopdf Library without using executable - ruby-on-rails-3

In ruby on rails project.
I am using PDFKit gem for generating pdf reports
PDFKit uses wkhtmltopdf executable which is to be installed on the machine .
And next step to give the path of the executable .
I dont want to use the executable file .because if i use it how to deploy it on server .
the server will need to install it on its local and give the path.
Is it possible to use only library????

The executable is used to wrap the underlying Qt app, so it's technically possible to wrap the library in a gem (using ffi or some other similar lib) but I never heard anybody doing it.
I'm myself bundling the executable with my Rails app, to ship both at once when I deploy (even on Heroku).
To do the same, you can put the binary file in directory (you can call it bin), and configure PDFKit to get the executable where it's at using PDFKit.configure in an initializer for instance (you might wanna check the README).

Related

No detect the external library (Phpoffice) in yii2

Two computers are working on the SAME repository but first computer detect the library and work well but second computer not detect it and show "Error 'PhpOffice\Phpspreadsheet\Reader\Xlsx' not found".
In vendor, the library also exist.
composer.json and composer.lock also the same on both computer.
One thing is that by git ignore, I use yii's composer mechanism at 1st computer but at sec computer(err computer), I add library manually.
If you want to use a composer package, you absolutely need to install it using composer. This ensures that the autoloader is generated properly and your class can be found through PHP.
Copying library files into vendor directory is not enough to install it. During installation Composer creates autoload script with information how to find all classes installed by Composer. If you just copy library files, Composer will not even know that it exist and will not able load any class from it.
If you cannot use Composer on server/computer A, you should install all dependencies on different computer (B) and copy the entire vendor directory into server/computer A. Autoload definitions are in vendor so it should work if you copy the whole dorectory.

What is the default path in .desktop files and how to change?

I am installing a package manually on my own system because I need to make some changes to it that aren't available in the basic version in my package manager. I also am trying to keep packages installed locally if possible, so I'm installing it with prefix=$HOME/.local instead of the more common prefix=/usr/local.
When I do this, I have no problem executing the program from my terminal, because I added ~/.local/bin to my PATH and the package was installed with relative paths to its shared libraries (i.e. ~/.local/lib/<package>). Executing from the command line is no problem, but I want to be able to access it from the favorites menu in gnome, and for that I need to make use of the <package>.desktop file.
I could hard-code the path to the executable in the .desktop file itself, but when I pull a later version down and re-install it, I'll have to redo those steps. I was wondering if there's a way to avoid that.
I've tried symlinking the executable to a directory where .desktop files do have included in their path, and the application is correctly treated as a GUI option, but launching the executable results in an error trying to find a shared library. I think this has to do with how cmake handles rpaths, which to my understanding is a way of relatively linking executables with their required libraries.
I think what I want to do is have PATH inside a .desktop file include ~/.local/bin, without changing the .desktop file itself. Can I alter the 'default' path used in accessing a .desktop file?
The answer to my question was found in the Archwiki:
Specifically, I needed to add ~/.local/bin to my path in ~/.xinitrc. Now my graphical programs work as expected.

Get Version from binary inside app directory

I have a helper tool in my bundle that resides in Contents/Library/PriviledgedHelperTools inside my .app. Can I somehow read the version of the info.plist of this program?
The Helper Tool itself is NOT a .app bundle, it is a binary that is embedded in my .app bundle residing in Contents/Library/PriviledgedHelperTools which has its Info.plist embedded inside of the __TEXT section of the binary using the linker flags
-sectcreate __TEXT __info_plist path/to/info.plist
Please note: I am currently not running this program, I just want to check if the currently installed helper tool is older than the one in my bundle and need to check if I have to update the helper tool (e.g. if its comming from a previous version of my program).
Just list all files inside the app dir. There are "version.plist" and "Info.plist" files that you can parse with simple script. If the app has another app inside then its structure is similar to parent.

How to install a FindXXX.cmake to a correct location?

I am developing a library which uses CMake to control it. It would be good to provide a "FindXXX.cmake" which locates the library and header files. This file would enable the users to use the command "find_package(XXX)" to find my library.
However, I don't know how to install my lib's "FindXXX.cmake" to an correct location. I failed to find a CMake's build-in mechanism to install a "FindXXX.cmake". In addition, CMake's variable "CMAKE_MODULE_PATH" is a list of directories, so I cannot install according to that vairable because I cannot decide which specific directory to use.
If the copy of CMake is installed to a standard location(i.e. use no prefix etc) then this can be done by placing the file in /usr/share/cmake/Modules/ directory.
If you are going to supply a bundle probably you can add some commands to check if the cmake is available. if yes you can check for cmake --system-information|grep _INCLUDED_SYSTEM_INFO_FILE value from that to get modules directory.
Otherwise there's no way you can do that.
A workaround can be done i.e. if there is a binary in your bundle then you can add a command line option for placing this file.

Yii Documentation: Generate Html Help Project files

I need to generate MS html help project files (that is html/js/image files plus .hhp, .hhk, and .hhc) from Yii Docs build system but I'm yet to find how to do It. I don't need a compiled CHM, just the project files. I work from Ubuntu Linux
Any pointer or direct help is appreciated.
Installed PHP Unit and Selenium extension via pear
Then I went on to run phing in yii/build dir with commands
cd yiidir/build
phing doc
check API sub directory and it have all necessary files to make CHM.
Since I needed uncompiled files then I just ended here but you can go ahead and compile to CHM