How to embed version / copyright / manufacturer information in a shared library - linux

Dynamic libraries on Windows (.dll) support a predefined format for storing meta data such as version number, copyright, manufacturer, etc. directly within the library itself. Retrieving that information is as simple as viewing the properties of the library.
Now, I'm looking for a way to do something similar on Linux. Can anyone tell me how I can embed such meta data directly within a shared library (.so) and point me how to extract that information with standard tools on Linux?
Is there a predefined way to do so at all?
While researching that topic I came across the same question on SO. However, that question dates back to 2010 and the accepted answer seems to no longer be recommended.
So, how is this done in 2019?

Related

Swift3 Linux vc Mac DispatchQueue

According to swift.org/migration-guide, dispatch and related functions have a great new swift interface (e.g. dispatch_async -> DispatchQueue.async). Also other foundation types have been added like Data and Date value types instead of NSData and NSDate.
However, on the open source version of swift3 (developer preview 1) on linux, ubuntu15.10 the compiler rejects all of these changes. In fact, looking at the open source version of swift and swift-corelibs on github, I don't actually see any of these changes. Since it will compile on XCode developer preview, this has lead me to believe either: I am doing something wrong on Linux or these changes have been made in the Apple branch and not the open source branch. Can anyone verify this and if the latter is the case, and if so, how do we know what changes will be in the Apple branch vs the open source branch?
As of Swift 3.0 release version GCD is available on Linux with simple import Dispatch, which is slightly confusing as it's not needed on iOS/macOS, where Dispatch module is imported by default.
Thanks to Brad Larson for finding the Foundation and Dispatch overlays in the source. According to swift.org:
SDK Overlays: Specific to Apple platforms, the SDK overlays
(implemented in stdlib/public/SDK) provide Swift-specific additions
and modifications to existing Objective-C frameworks to improve their
mapping into Swift. In particular, the Foundation overlay provides
additional support for interoperability with Objective-C code.
tl;dr anything in these folders are Apple platforms only. Still not sure why they restricted the Dispatch overlays to Apple Platforms since libdispatch is also open source and targeting linux, but this answers my initial question.
Edit: was able to confirm via swift mailing lists that the dispatch overlays do have some reliance on objective-c runtime. There is work to get them implemented for non-Darwin platforms but no guarantees on timing.
Check out the Swift 3 Evolution Github page. They list all the proposed changes to the language, and separate them by those that have been implemented and those that have not. Proposal SE-0088: Modernize libdispatch for Swift 3 naming is on the "yet to be implemented list" as are many other changes.
As far as Data and Date are concerned, I cannot say, since I believe that is part of the upcoming Core Libraries, and I have not yet been able to look at those in great detail yet. Perhaps you might check the Swift Core-Libs Github page as well, though the status page references work done on NSData and NSDate, no mention of the newer data types.

How can I create a customized version of an existing pdf file with node.js?

I have an old system that was written in PHP a long time ago that I would like to update to node.js to allow me to share code with a more modern system. Unfortunately, one of the main features of the PHP system is a tool that allows it to load an existing PDF file (which happens to be a government form), fill out the user's information, and provide a PDF to the browser that has all of that information present.
I have considered making a PHP script that will just do the PDF customization and using node for everything else, but it seems like something like this should be able to be done without requiring PHP to be installed.
Any idea how I might solve my problem just using node?
After a lot of searching and nearly giving up, I did eventually find that the HummusJS library will do what I want to do!
Update April 2020: In the intervening years since I posted this other options have cropped up which look like they should work. Since this question still gets a lot of attention I thought I'd come back and update with some other options:
pdf-lib - This one is my current favorite; it works great. It may have limitations for extremely large PDFs, but it is constantly improving and you can do nearly anything with it -- if not through the helper API then through the abstraction they provide which allows you to use nearly any raw PDF feature, though that requires more knowledge of the PDF file format than most possess.
It's worth noting that pdf-lib doesn't support loading encrypted pdfs, but you can use something like qpdf to strip the encryption before loading it.
https://www.npmjs.com/package/nopodofo - This one should be one of the best options out there, but I couldn't get it working myself on a mac
https://www.npmjs.com/package/node-pdfsign - Not exactly the same thing but can be used with other tools to do digital signatures on a PDF. Haven't used it yet, but I expect do
Update Dec 2021: I'm still using pdf-lib and I think it's still the best available library, but there are a lot of new libraries that have come out in the last couple of years for handling PDFs, so it's worth looking around a bit.

Tracker or Recoll?

I want to use Tracker to index my PDF collection.
Before I choose a tool I searched around for available Linux indexers and one of my references is this wiki: link, where is stated that Tracker does not support full text search while tracker website says it does: link
I want full text search so I thought to ask here for opinion and answer which tool is best in my scenario (just PDF FTS indexer) on Debian where performance is also considered and "live" indexing is not required
Probably you already found your tool, anyway seems that http://www.recoll.org/ does the job. PDF is a supported format (be careful installing the required dependencies on debian) and after the indexing task, you can use it without the need of daemons wasting your resources.
Reference at this article for a deep, and very comprehensive, comparison of tools.
http://richfriedeman.com/2010/02/28/choosing-an-open-source-desktop-search-tool-part-3/

What to resources to read to import Excel data to AutoCAD?

Doing some preliminary work on a project. I work at an engineering firm and the engineers build Excel spreadsheets containing information on what material the project uses (called cable schedules). This data is handed over to the drafter and they turn it into an AutoCAD drawing. If a change in the spreadsheet gets made the drafter needs to meticulously change every drawing. This is supposedly a lot of manual work.
I know little of AutoCAD and was wondering what research I should do to see if and how hard it would be to automate this process. If a course or books are available I'd like to be pointed in that direction.
If you're looking to simply display some Excel data as a table in AutoCAD the functionality is already built in via AutoCAD's DATALINK command.
If you want to automate something more complicated than that check out Autodesk's ObjectARX. It's used to create AutoCAD plugins and can be downloaded for free from their website. ObjectARX exposes both .NET and native C++ APIs. It is the library that AutoCAD itself is based on.
The RealDWG API (formally ObjectDBX) that Chris Neilsen mentioned is a subset of the functionality available in ObjectARX. It allows you to read and manipulate AutoCAD drawings outside of an AutoCAD process. RealDWG is, however, not free.
As for documentation, the help files and samples included with ObjectARX are pretty good and there is a fair amount of programming discussion on the Autodesk and AUGI forums. If your employer is an ADN member you'll find a lot more information there, including professional support.
See this SO Question for a discussion of libraries to access drawing files, including ODA and
AutoDesk RealDWG and a few others
The library I use for manipulating Excel from AutoCAD is available as a download here:
http://download.cnet.com/KozMos-VLXLS/3000-2077_4-94214.html
I found it far easier to use this inside the VLIDE to manipulate Excel data (whether it has anything to do with AutoCAD or not), than to use Excel's VBA (a horror) or a combination of scripting and interop.
I did have to fix one or two mistakes in there, so bear that in mind...

Creating & Editing MS-Word documents on a linux server?

Looking to develop server-side application that will process documents. The source documents are mostly MS-Word 2003, 2007, i.e. the MS version of Docx. Want the server application to be able to run on both linux or windows.
Wanting to know what is the best tool or library for reading and writing MS-Word files under linux. Compatibility is the most important consideration. Must preserve source document formatting including tables.
I have seen a kind of similar post here but it was specific to python. I don't care what language or libraries are used as long as they are available for windows and linux.
Must not require MS-Word to read the Word files.
I am aware of Open Office but am looking for a solution which has a high degree of compatibility with MS-Word files.
Also just came across this solution which looks promising. aspose.com
Anyone had any experience using Aspose.Words for Java or similar 3rd party packages? It looks promising but it's pricey at over $2K for an OEM subscription. That said if it delivers as advertised it may still be the best solution out there.
thanks
There have been a couple of suggestions but nothing so far which would fits the bill (or the budget).
Have you considered using b2xtranslator to convert binary .doc to .docx. (On Linux, you'd have to run it in Mono)
You could then use POI or docx4j to manipulate the docx. Not a solution if you need to save as .doc though (unless you use OO for that bit)
Ok, I'll have another go at an answer ;-)
What about using unaconv
It can convert any document OpenOffice can read to any document OpenOffice can write. You should be able to use that to convert both to/from MS-Word documents (providing they're not overly complicated which I've found open office can't handle very well).
The only caveat is that you need to have an instance of OpenOffice running on the linux server for unoconv to interact with.
Mono has recently acquired support for the system.io.packaging .net class, which allows some degree of manipulation of docx files. If the kind of thing you want to do is add/remove resources and recurse over the text, it's probably the right thing.

Resources