Ghostscript prints question mark when converting digitally signed PDF to image - ghostscript

Ghostscript 9.0 doesn't support validation of the digital signatures in PDF document when doing PDF to image conversion. Instead, there's a question mark on the digital signature, and Ghostscript reports "Sig is not yet implemented". I'm thinking to modify the source code to get rid of the question mark, but I don't have any ideas to where I should modify in thesource code. Could any one give the hints for that? Any response will be appreciated highly, thanks.

Have you already tested the very latest release (which is v9.02)? If so, have you also tested the current 'HEAD' revision of their source code?
If your problem persists with these versions, the preparatory thing to start with is to download the (current, which is v9.02) Ghostscript source code from here or even check it out from their Git repository.
What you are trying to do can only be located in one of the following two modules of the Ghostscript source code:
the (PDF) interpreter
the (image) output devices
So I would first recursively grep the sources for "not yet implemented" or similar expressions, taking into account that there may even be line breaks within the string. (***I doubt the quote you gave in your initial version of the question is accurate, because it contained at least one typo.)
If I didn't find anything in the first step, I'd get into touch with the Ghostscript developers themselves. They usually hang around in IRC on Freenode, channel #ghostscript. In general they are a very friendly and helpful bunch, and they'll surely be able to give you some hints about how to solve your problem if you know how to ask...

Related

Three.js Typeface.js offline

the problem is obvious from the title, http://typeface.neocracy.org offline. It was used to convert fonts and used in conjunction with THREE.TextGeometry. But if it is offline, how is now possible to use custom fonts in three.js?
I made a new converter that outputs the same files as typeface.js.
http://gero3.github.io/facetype.js/
I loaded the source, but as far as I can see there is no chance to create the JS-font-files with this distribution. Maybe for someone with deep perl-knowledge...? In any case I installed perl, the ppm and dmake but trying to exec the Makefile only leads to errormessages about missing files. No - this is no alternative to the online-converter. Even worser: I didn't find any other converter or another side using the same one (cufon seems to create another format). So let's hope the site comes back to live - otherwise the great textfeature of three.js is worth nothing in the moment.

Wkhtmltopdf version, first page and TOC

Some questions for this very nifty tool, unfortunately lacking many usage examples.
Manual speaks of a possible “Reduced Functionality” for wkhtmltopdf. I have version wkhtmltox-0.11.0_rc1-installer.exe, by running wkhtmltopdf --version what should I read to understand whether my version is the reduced one or not?
Currently I like wkhtmltopdf for webpages I want to read later and/or store. To mirror webpages I use httrack, then I generate the PDF with wkhtmltopdf *.html offline.pdf. How can I set/specify the first PDF page from the *.html list? Currently they seem to be converted in alphabetical order.
If I run wkhtmltopdf toc http://qt-project.org/doc/qt-4.8/qstring.html qstring.pdf I simply get a leading blank page, no TOC. What’s wrong?
Thanks for helping
EDIT:
#Nenotlep:
Your TOC trick works perfectly.
As for the first page, I don’t need an actual cover.
What I need is a way to download/convert a given page www.site.com/foo.html and all the linked pages (A.html, B.html ...) up to a certain depth level. Then I want a single PDF starting with foo.html and containing also the pages A.html, B.html ... (with relative links).
I don’t think there is an option to download and insert the linked pages in the final PDF (please, correct me if I am wrong). So I use httrack.com to download and wkhtmltopdf to convert. Given the alphabetical behaviour of wkhtmltopdf, the best now seems to rename the target page, downloaded with httrack, something like !foo.html.
Please, let me know of possible alternatives.
For part 3 of the question which is blank TOC, the latest stable version 0.12.5 also does not generate it. The pre-release version 0.12.6-dev has fixed this problem in Mac.
I think all available precompiled wkhtmltopdf's are compiled with the patched QT, they are not reduced. The reduced functionality means that it was compiled without a special patched version of QT. I use the windows version and it isn't reduced.
I think the cover command line argument would work for you. I can't test at the moment, but try a command like wkhtmltopdf cover derpy.html toc --xsl-style-sheet default.xsl rarity.html twilight.html spike.html equestriadaily.pdf
At least in Linux, I think the asterix *.html simply explodes into all the html files before the command is performed, so if you select one html file for the cover and then do *.html in the same folder you will get the file twice. Getting around this issue might need some command line sorcery or a batch file or some other trickery.
This is a bug in wkhtmltopdf. The workaround is to manually set a tocfile. You can get the default tocfile with wkhtmltopdf.exe --dump-default-toc-xsl. Then you can save the output as a file and use it like wkhtmltopdf.exe toc --xsl-style-sheet default.xsl www.stackoverflow.com so.pdf.

Example source code for SignerSignEx to sign an .exe file?

I want to codesign an .exe file using an API rather than running signtool.exe. The documentation for SignerSignEx is here:
http://msdn.microsoft.com/en-us/library/aa387734(VS.85).aspx
It seems to be recommended as a modern replacement for the CapiCom library, based on this documentation:
http://msdn.microsoft.com/en-us/library/aa375732(VS.85).aspx#_crypto2_digital_signature_objects
Is there any sample code somewhere for how to use it?
You can find a simple enough sample here in Alejandro Campos Magencio's post.
It begins with CAPICOM, but fear not, the second half is about SignerSignEx. It also ends with a troubleshooting tip.
I've always used signtool.exe myself. Are you having any issues with it?
G'luck

additional settings for wkhtmltopdf?

I am converting some docs to pdf using wkhtmltopdf (currently using perl and the command line versions). Is it possible to change the "PDF Producer", "PDF Version" and "Fast Web View" fields? The current defaults are "wkhtmltopdf", "1.4 (Acrobat 5.x)", and "No", respectively. I didn't see anything in the wiki page
Pass the following with the command line to see supported features: " --extended-help"
Not sure if those specific params are supported or not.
I patched wkhtmltopdf to support an additional flag recently, and it would be quite easy to add parameters to change those. I don't believe they are supported currently, though.
PDF Producer: Nope. Most apps want folks to know that particular app generated the PDF.
PDF Version: Nope, but trivial. The version number at the beginning of the file is just a courtesy really. What exactly are you after with this? Chances are you don't really need it. The PDF generated isn't going to acquire any features automagically just because the PDF claims to be this version or that. It's only really used so a viewer opening a newer PDF can say something like "I don't support this version, some stuff might not work". Because everything will work regardless (unless someone happens to have a VERY old version of Acrobat/Reader), I don't see the issue.
Fast Web View: Nope, and decidedly non-trivial. "Fast Web View" means everything needed to display the first page of the PDF is sorted to the front of the file, and there are various "hints" on where an app downloading the PDF can find this or that. It's not just a flag, not by a long stretch.
Zero for three. Sorry.

Linux tool to show SLOC and SLOC modified, added, removed

I am currently using the SLOCCOUNT tool for gaining source lines of code (SLOC) for a codebase.
However, it doesnt support comparing two versions of the codebase and then report:
Lines of code (LOC) modified
LOC removed
LOC added
Can anyone suggest a linux based (preferably free) tool to do this?
I've used CODECOUNT for differencing baselines. This compares changes, deletions and additions between different code bases. It's provided free of charge by the University of Southern California.
They only provide source code. However, it built cleanly out of the zip file in cygwin using g++. They also claim support for Visual Studio, but I have not tried it.
I beleive diffstat utility does that.
It sounds like SLOCCount and SLOC Compare can show you the trend over time, but it isn't exactly what you are looking for.

Resources