Server side solution to convert PDF to SWF? - pdf

I've found some tools that can convert PDF to SWF, but I'm hoping to find something or even a library to be able to be able to incorporate this on the server to be able to store the SWF in a database.

Have you tried SWFTOOLS? On Debian/Unbuntu:
sudo apt-get install swftools
pdf2swf filename.pdf
http://wiki.swftools.org/index.php/Examples#pdf2swf
They have a Windows version, and the source so you can compile it on other Linux flavors.

Related

Tess4J - Native library (linux-x86-64/libtesseract.so) not found in resource path

I'm using Tess4J (JNA wrapper around tesseract), and trying to call tess.doOCR(myFile) to OCR text from a single-page PDF.
I have GhostScript installed (by using yum install ghostscript), gs -h works correctly.
My app server is using 64-bit JVM, and I have gsdll64.dll, and the 64-bit tesseract dll's liblept168.dll and libtesseract302.dll in the class path.
When tess.doOCR(myFile) is called, this is logged:
GPL Ghostscript 8.70 (2014-09-22)
Copyright (C) 2014 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
But then it just stops there. The program doesn't go any further.
UPDATE --
It looks like the real issue is from this error:
java.lang.UnsatisfiedLinkError: Unable to load library 'tesseract': Native library (linux-x86-64/libtesseract.so) not found in resource path
After looking around a lot, I don't see a convenient place to find this libtesseract.so file, and I'm not sure what it takes to get this onto my Linux app server. I read that maybe I need to download some C++ runtime, but I don't see a Linux download for that. Any advice would be much appreciated.
Or is this something to do with a symbolic link?
The Fix was simple for me,just do sudo apt-get install tesseract-ocr from the command line. For linux you dont need to worry about the DDL librarires or the jvm version. Installing tessearct from apt-get will do the trick.
Those DLLs are for Windows. For Linux, you'll need to install or build from Tesseract source.
That GS version, 8.70, is quite old. The latest Ghost4J library that Tess4J uses is not compatible with that.
Tess4J should include required libraries. However, you need to extract them first.
This should do the trick:
File tmpFolder = LoadLibs.extractTessResources("win32-x86-64"); // replace platform
System.setProperty("java.library.path", tmpFolder.getPath());
You should replace the argument of extractTessResources(..) with your platform. You can find possible options by looking into the Tess4J jar file.
This way you need not to install Tesseract on your system.
Recently I wrote a blog post about Tess4J in which I used this technique. Maybe it can help if you need further information or a running example project.
sudo apt-get update
sudo apt-get install tesseract-ocr
download test data by git
https://github.com/tesseract-ocr/tessdata

Install SQL Developer mac osx 10.9.1

i'm trying to install Oracle's SQL Developer in my macbook pro OSX 10.9.1 but I can't understand how to do it. I download a .gz file which I unzip to get an installer but all I have is an unknown file called sqldeveloper-4.0.0.13-1.80-macosx. It is not a .dmg or something so i don't know what to do whith it.
I've read that i'm supposed to run over the extracted directory something like sh sqldeveloper.sh from the terminal but that file isn't there, just the one mentioned above.
thanks
Extraction problem, "The Unarchiver" utility produced the unknown file, I decompressed the file download from Oracle's website with the Archive Utility and I got the installation file

PyCharm and external libraries

I have started to use PyCharm IDE, but I was not able to determine how to manage external libraries there. For instance, PyCharm does not see matplotlib. In PyCharm's file manager, I clearly see the list of external libraries and there is no matplotlib. However, I have it installed and I know its location.
How can I add this library to PyCharm environment?
I suggest to use Python virtual environment. It is really easy with PyCharm.
PyCharm > Preferences... > Project Interpreter > Python Interpreters
Click "Create Virtual Environment" and pick your base interpreter.
Click "Install" and install any packages you need. You can also add other repositories if the default ones do not contain required libraries. Another benefit is that you can see which libraries have newer version and can be updated.
I think one way to solve a problem is to specify your interpreter in PyCharm itself via File -> Settings -> Python Interpreters
There is also a Paths tab in this setting, you need to add path to your matplotlib explicitly there. But for me there is no special path listed there. Here are my paths in this tab:
file://D:/hg_work/vefw_regression/tools/python/DLLs
file://D:/hg_work/vefw_regression/tools/python/Lib
file://D:/hg_work/vefw_regression/tools/python/Lib/lib-tk
file://D:/hg_work/vefw_regression/tools/python
file://D:/hg_work/vefw_regression/tools/python/Lib/site-packages (my matplotlib/numpy and other stuff is here)
file://D:/hg_work/vefw_regression/tools/python/Lib/site-packages/win32
file://D:/hg_work/vefw_regression/tools/python/Lib/site-packages/win32/lib
file://D:/hg_work/vefw_regression/tools/python/Lib/site-packages/pythonwin
file://D:/Users/svecovs/AppData/Roaming/JetBrains/PyCharm Community Edition 3.0.1/helpers/python-skeletons
file://D:/hg_work/vefw_regression/tools/python/Lib/site-packages/core (added by user)
Install matplotlib and then python-tk.Pycharm will function well.It's working for me at Ubuntu 16.04.
sudo apt-get install python-tk
sudo apt-get install python-matplotlib
For Linux Users here is a solution ,
firstly write this command in the terminal ,
sudo apt-get install python-matplotlib
Now you're done you will be able to see matplotlib in File>>>settings>>project interpreter.
Image
Solve this problem by choosing system interpretator.

Trying to use ffi and typhoeus gems on windows but I need libcurl

I'm pretty new to rails and I'm trying to get an application working. It's currently using ffi and typhoeus which need a version of libcurl. How can I install a version of libcurl for Windows 7.
Thanks!
There's one option I implemented but couldn't install only libcurl packages. Cygwin provides lots of the packages and libraries used for development in Linux for being installed on Windows (included curl, libcurl, libcurl-dev, etc).
http://www.cygwin.com/
It worked for me in windows 7 64 bit OS.
Here's another solution for that specific gem
https://github.com/typhoeus/typhoeus/pull/151/files
Greetings.
Answer that worked for me was:
Download cURL from the following URL: https://curl.haxx.se/windows/ (I chose 64bit because that's the system I'm using)
Go into the archive and browse to /bin
Locate libcurl_x64.dll (it may be just libcurl.dll)
Extract to your local drive
Rename it to libcurl.dll if it has the _x64 suffix
Cut + paste the file into the /bin directory of your Ruby installatio
It should work after this

How can I programatically convert SVG files containing text to PDF files (specifically on CentOS 5.3 x86_64)?

I would like to programatically convert SVG files to PDF files. However, the SVG files contain text that must be searchable in the generated PDF files. Also, it has to work on Red Hat Enterprise Linux 5.3 or CentOS 5.3 for the x86_64 architecture. It would be nice if it were Open Source or at least not very expensive.
Here is what I've tried. All of these, except Batik, work fine on Debian Lenny.
Inkscape
I can get it installed using autopackages from http://inkscape.modevia.com/ap, but when I use it from the command line, the text is not searchable.
Batik rasterizer [sic]
When it converts SVG files to PDF files, the text is no longer searchable.
svg2pdf
The source for this and several of its dependencies are available to download. I have been trying to get it to compile on CentOS, but haven't had success yet. I found a precompiled version for Debian x86_64, but it doesn't work on CentOS.
rsvg-convert
Generated PDF isn't searchable on CentOS 5.3. Perhaps installing a newer version of cairo would help. Thanks to DaveParillo for mentioning rsvg-convert (on superuser).
SOLUTION (but perhaps some of the above will still be useful to the reader)
princeXML
It works fine on CentOS when installed from source. For some reason it doesn't work when installed from the .rpm. Thanks Erik Dahlström!
Cross posted on superuser
You could try princexml, it's free for non-commercial use.