Do I need multiple test fixtures for PDF (.AI) conversion with ImageMagick - imagemagick

I implemented a specialized utility for my team to batch convert AI files to other formats. It's using imagick and works well with the 1 AI file I used. They to need officially support Illustrator v 9 and upward.
Is it sufficient enough to write a test for the utility using an AI file saved for Illustrator 9 and be confident that the embedded PDF data is similar enough that I don't have to add test AI files saved in other versions of AI?
In other words, if it can properly convert the PDF (in the AI file) saved with Illustrator v 9 then all other formats will convert 100% the same?
Or should I add test fixtures (AI files) for each other version of Illustrator because the natively supported PDF format changed significantly?
Or ... does ImageMagick already account for these differences?

I tried same thing before. Simple answer is there is always something different. After trying for almost 3 months. I decide to use Illustrator Javascript API to convert files. And it works well.

It really depends on the version of GhostScript installed because ImageMagick uses GhostScript for converting from PDF.
If the version of AI used is 9 and above, and if the .ai file is saved with PDF compatibility and your GhostScript is up to date .. then GhostScript should have no issue converting it regardless of the version of Illustrator (from 9 or above) that it was produced with. Illustrator specific information is saved at the end of the PDF file which affects the specific version of Illustrator and this is data that is not consequential to GhostScript.

Related

Difference between dcm2pnm, dcmj2pnm and dcml2pnm

The title says it all. What is the difference between dcm2pnm (http://support.dcmtk.org/docs/dcm2pnm.html), dcmj2pnm (http://support.dcmtk.org/docs/dcmj2pnm.html) and dcml2pnm (http://support.dcmtk.org/docs/dcml2pnm.html) commands of dcmtk toolkit (http://support.dcmtk.org/docs/pages.html)? They all seem to convert dicom images to other formats. Are there any special situations where one should be preferred over others?
Edit: It seems dcml2pnm supports more formats. Why not use that for all purposes? What are the advantages of other commands?
I am the DCMTK developer.
The difference between the three DCMTK command line tools is: support for compressed DICOM images and output formats.
dcm2pnm was the original tool that has been developed more than 20 years ago and which originally only supported the image format PNM/PGM for output (that's also why the tool is called "dcm2pnm" and not "dcm2img" or the like). And, because at that time the DCMTK did not support any encapsulated transfer syntaxes (i.e. compression), only uncompressed DICOM images can be read.
dcmj2pnm is located in DCMTK's submodule "dcmjpeg" and adds support for JPEG-compressed DICOM images (based on the IJG library) as well as the JPEG image format for output.
dcml2pnm is located in DCMTK's submodule "dcmjpls" and adds support for JPEG-LS-compressed DICOM images (based on the CharLS library). It does not support conventional JPEG.
All this is probably more obvious from the source code package than from the binary package but it is also mentioned in the above referenced documentation (see "Description" section).
If you'd ask why there are three different tools (in fact, there is also a fourth one for JPEG-2000 support but that not part of the public DCMTK), my answer would be: this is mainly for historical reasons but also for reason of keeping dependencies between the various DCMTK modules as simple as possible.
Furthermore, we consider the command line tools as a kind of sample applications of the underlying C++ class library. So, if you'd need a tool that supports all image compression schemes available in the DCMTK, it should be easy to write such a tool.
dcmj2pnm adds JPEG codecs to the dcm2pnm functionality. Thus, it is capable of handling JPEG compressed DICOM data and produce JPEG output images. So it is a superset of dcm2pnm's functionality.
I think this is, because dcmtk offers different compile options which allow to include / exclude libjpeg. Just reflects the toolkit's options to the accompanying command line tools. Confirmed by the list of file formats when you start with option -h
For dcml2pnm I am not sure, but this is a good guess: Same as for JPEG but includes the JPEG-LS encoder which is another optional 3rd party toolkit for dcmtk.

Convert ePub to PDF in iOS

I am new to the iOS development and am developing document based iPad appliactio. So,
Is there any way to convert the epub document to pdf document in iOS. Please let me know.
Thanks
Mahesh
I personally don't think that iOS have some tools to do that. Best choice will be upload your document to some unix server and then convert it with pandoc for instance. But be aware that this type of conversion is poor quality fo 99% of documents.
Seconding pandoc (for which you'll want an OS X, Linux, or Windows system), though I'm here looking for the solution.
Some tips though:
An EPUB document is a structured format contained within a ZIP file. Unpack that and you'll get the document in HTML format, plus images, plus structure information.
Pandoc is a very nifty converter that will take single documents and convert between many, many file formats, including markdown, HTML, LaTeX, PDF, and ePub. It won't read from ePub natively, though it seems to me that if you can parse the package.opf file you should be able to reconstruct the document in the form you prefer.
My general thought is to create LaTeX source from the HTML documents, and use that to produce PDF (or other) outputs. I'm seeking tips on simplifying and automating this, will follow up if I find more.

Creating a bitmap object from tiff image

I have a page with a gallery where users upload images. I noticed that there is one particular user who uploaded 3 tiff images and that they cannot be accessed.
Exception type: System.ArgumentException
Exception message: Parameter is not valid.
It happens here:
using (Image photo = new Bitmap(new MemoryStream(photoData)))
Files seems to be ok, sice File.ReadAllBytes() works, I can download them using other method (the one not working is used for returning a resized image only), test locally and the exception is not thrown. Any ideas what could be the case? Unfortunatelly I dont know yet if this occurs for all tiff images uploaded by other users too.
Support for TIFF flavors (and there are many of them) depends on the version of Windows on your server. More precisely, it depends on GDI+ library's version.
Without seeing the TIFFs there is nothing more I can tell. But I can recommend you to try some 3rd party libraries just for TIFF files. There is de-facto standard libtiff library and I have ported it to C# some time ago. You might try the port.
There are some samples you might be interested in. I think Convert color TIFF to a 32-bit System.Drawing.Bitmap might be most eligible for your task.

Tools to help me learning Apple Quick time file format?

When I was learning Portable Executable (PE) file format for windows, tools like PE-Explorer and PEView helped me in learning things quickly and nicely. Now, I need to learn and understand the apple quick time file format. Are there any
Tools with which I can browse the quick time format?
Export sections of the file?
Any additional resources other than the specifications?
PS: I'm on windows and I don't have mac/macOS
Tools with which I can browse the quick time format?
On Windows you can use MP4 Explorer, and since it is open source you can also learn from it. Since MP4 uses a similar structure to QuickTime you can use it for both.
There is also the old Dumpster tool from Apple. There is an old version of this tool for Windows, but I could not find it in the Apple developer site. This forum post has a copy that you can try. This is very old though, I'm not sure if it'll work with recent QT files.
If you can obtain access to a Mac running OS X, then you can use Dumpster or Atom Explorer.
Export sections of the file?
I don't know of any public tool for this. Your best bet is to extend MP4 Explorer to do this, or write your own parser. Parsing the atoms is actually pretty simple, things start to get complicated when you need to interpret the content of the atoms and cross-reference them to, for example, locate where the frame data is.
Any additional resources other than the specifications?
The QuickTime file format specification is the best resource for Apple generated QuickTime files, but you may need to do some reverse engineering, as the spec is not very complete in some areas, like the handling of MPEG-2 and MPEG-4 video. If you have access to ISO specs, then ISO/IEC 14496-12 is a standardized version of the QuickTime format (or better said, of a subset of it). The ISO/IEC 14496-15 specification builds on top of 14496-12 and defines a specific implementation of this format for the H.264 format. This is the so called MP4 format.
With the above three documents you should be pretty good in terms of documentation.
The MPEG4 (.MP4) file format is based on the QuickTime file format. You should be able to use the MPEG4IP tools to examine .MOV files. You can find windows binaries here.
Media Box Viewer does exactly this and much more. In addition to Quicktime, it can also open mp4, 3gp, etc. It runs on all platforms, Windows, Mac, Linux, etc.
It can be downloaded from www.jdxsoftware.org.

Create a thumbnail of a dwg in in a linux environment

Creating a ruby on rails site that uses RMagick to create thumbnails for many types of images. RMagick cannot read dwg files however.
I've tried a few things, looked into the Java library JDWGLib, which would probably allow me to write a converter, but it would be a total from the ground up solution, where I just need a thumbnail.
Also considered using a viewer program to open the file in a remote X session and do a screen capture, however I'm not sure how I could ever guarantee that the viewer had completed opening when I took the screenshot.
I'm not concerned with being able to manipulate the file other than to create the thumbnail. It is going to be used for commercial purposes, so any libraries used need to be compatible.
cad2svg is a simple Linux command-line utility that automatically converts AutoCAD files (both dwg and dxf) to SVG.
the link
I could not find any command-line-able tool for making thumbnails, on either windows or linux.
I guess you could download the DWGdirect lib (C++) wich allows the exportation of a DWG to a bitmap... but this requires purchasing a membership license on the """Open""" Design Aliance.
I would recommend adding an additional file input on your form that says "thumbnail". And let the users provide the screenshots.

Resources