Is there a way to display postscript (.ps) files on iOS? - pdf-generation

I need to display .ps files in an iOS app. Native support for .ps to .pdf conversion appears to be switched off -- CGPSConverter,
https://developer.apple.com/documentation/coregraphics/cgpsconverter?language=occ
are not available on iOS:
https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_ps_convert/dq_ps_convert.html
Does anyone know of another way? Is there any 3rd party library that could help me here?
Please note that a Ghostscript/Pdftk based solution won't work due to GPL licensing terms.

Please note that Ghostscript is available under a commercial licence as well as GPL. In order to render a PostScript file you will need a PostScript interpreter, and there aren't very many of those. All the ones I know of are either GPL or commercial.

Related

Tool to explore PDF structure and internals on macOS?

I'm looking for a (free, GUI) tool to explore the internals and structure of PDF files on macOS (10.14.1). It looks like PDFXplorer from OS solutions (http://www.o2sol.com/pdfxplorer/overview.htm) would meet my needs, but no Mac version is available. I do not have Adobe Acrobat Pro. Surely, with the broad use of macOS in desktop publishing, there must be a tool to inspect the innards of a PDF! Any thoughts?
You may find an answer here, which includes lists of tools for parsing PDF data.
Best tool for inspecting PDF files?
Generally, in desktop publishing, the data streams of PDF are of little interest. Any problems, and the PDF will be re-made from the source artwork files, or edited/adjusted with Acrobat's preflight utility, or with a third-party tool like PitStop.
But this is without any user awareness of the actual data objects.

difference between ghostscript and ghost4j

i want to repring pdf files in Java application.
I found that ghostscript has Java library - ghost4j.
Do you have any experience with it - is ghost4j is as good as ghostscript ?
Thanks
Ghostscript does not have a Java library.
Ghost4J is a wrapper around Ghostscript (written in C) which makes it accessible from Java. This is not supplied nor supported by Artifex and is not part of 'Ghostscript', its an addition by a 3rd party developer.
That said, since it actually uses Ghostscript, it is potentially 'as good as Ghostscript', but it may well not expose the entire set of functionality.

Emacs Style “artist-mode” for Xcode?

Is there anything that resembles Emacs' artist mode available for Xcode?
In a word - no :-) It's likely to only have limited use. Most developers would problably use gif/png images and reference them in a way that headerdoc/doxygen/appledoc can refer to when generating the documentation files.

Are there any libraries for parsing AutoCAD files?

Are there any libraries (preferably open-source) for parsing AutoCAD files (DWG or DXF)?
Well,
For the DXF file format the specification is available online so you can write your own parser for this file format the document can be found here:
http://images.autodesk.com/adsk/files/acad_dxf0.pdf
But if you don't want to you can use libdxf an open source library to parse dxf files but according to the developer it's a “Work in progress” you can find it here:
https://github.com/bert/libdxf
or you can install it in ubuntu using command:
sudo apt-get install libdxflib-dev
Also another library that is provided by coin3d (can be used separately) is named dime and is probably the one used by freecad can be found here: https://bitbucket.org/Coin3D/dime
It also can be installed in ubuntu using the following command:
sudo apt-get install libdime-dev
For the DWG format you can use libredwg library it's from opensource foundation and you can find it here:
http://www.gnu.org/software/libredwg/
But please note that according to Wikipedia it has licensing issues of its own.
http://en.wikipedia.org/wiki/LibreDWG
A fork of libredwg is available under the name libDWG it is able to read DWG file formats R13, R14, R2000 and R2004 and can be found at : http://libdwg.sourceforge.net/en/
I tested the library and the problem is that most of the sample files online have a newer version than the library can load which is not very practical.
Another good page (with some code samples) of how to read autocad files can be found at ibm website here: http://www.ibm.com/developerworks/opensource/library/os-autocad/
Bottom line is using dxf is the better option since it's open and can be supported the dwg support can't be easily done.
Duplicate of (or at least related to) Open source cad drawing (dwg) library in C# & .Net CAD component that can read/write dxf/ dwg files
There isn't anything available for parsing DWG for free that I would regard as reliable. The Open Design Alliance tends to be cheaper & runs on more OS's than AutoDesk's RealDWG offering. The ODA has a price-tier for startups who aren't yet shipping code - RealDWG doesn't. Both the ODA and AutoDesk offer support in forums - you have to be a member of the ODA but AutoDesk's forums are at http://discussion.autodesk.com/forums/ where you can join for free.
DXF is a text-file format (similar to XML) which you can parse with anything you like - if you know what you're looking for. You may have more luck with finding a library for that (I haven't looked into it) but that would involve conversion from DWG format. Note that there are various releases of the DXF format
You can try Autodesk's DWG Trueview (free) but it is an end-user viewer - it doesn't officially offer an API. Some people have had varying degree of success in the past automating it. I haven't tried myself & I strongly suspect the latest versions have been hardened against that.
Ultimately, if you are working for high-profile clients who are likely to insist on, or at least balk at the absence of 'official' AutoCAD libraries and the "Trusted DWG" BS that goes with it then you may need to invest in a membership of the Autodesk Developer Network.
As a long-time end user I can tell you the devs at the ODA are more responsive to bug reports than AutoCAD.
The Ivan CAD Library works very well with DWG R15, R18, R21 and R24. I found it at www.ivancad.com

Develop Print Driver

I need to develop a print driver to print from any application into a TIFF file. Does someone know of resources or a good SDK vendor that would enable me to do that? Environment is Windows, any language.
The Microsoft Windows Driver Kit (freely available from the linked Microsoft site) has extensive documentation and examples on writing printer drivers. You can check the online printer driver page of the DDK docs before downloading it.
Edit: One commercial alternative that would probably be much quicker to deploy is VeryPDF's DocumentPrinter. It's rather pricy (currently $1500 for a developer license, $399 for a server license), but from what I've heard their support is rather good so if the price is tenable for you this may be a good option.
There's also a SDK from DirectConvert, but I couldn't find any pricing info and don't know anything about them.
Depending on your usage patterns, another option would be something like TechSmith SnagIt, which has printer capture facilities available. This is not a SDK, though.
Create a raster print driver using the Windows DDK. The sample they provide will do just fine. This will generate bitmaps, which can then be converted to TIFF using LibTiff. Your OEMSendPage function is where you'll want to convert the bitmap to TIFF and save it. If you're unfamiliar with the DDK and Windows print drivers, expect to spend quite a bit of time on this.
I have source for a driver I used to sell that does exactly what you want, but I stopped maintaining it after NT 4 so it's seriously out of date and would require some significant work to make it useful on modern Windows platforms.

Resources