Convert XPS to SVG - svg

Is there a direct and fast way to convert XPS (XML Paper Specification) files to SVG format?
I can convert XPS to PDF and then using inkscape to convert them to SVG.
But the PDF->SVG step is very time consuming though this process seems is not CPU consuming.
My understanding is that be cause XPS is a vector based format, converting it to another vector based format like SVG must be feasible and much faster than converting raster based format (though i'm not entirely sure pdf is just raster base) to vector based formats.
BTW, the goal is to display vector based images in browser, and I've XPS files.

libgxps reads XPS and can create SVG files.
I tried it on Cygwin with the xpstosvg command and worked fine.

I tried xpstosvg from the answer above to convert an XPS document with about 100 pages. Unfortunately, the tool produced only one large SVG image with about 90 MB file size, which was not exactly what I was looking for, since the file could not be viewed and I needed one image per page.
Also the manual of the program did not give any hint how to get one image per page. In the end I used an online XPS converter, which really created a SVG image for each page.

Related

Extract vectorized data from a pdf with non-embedded fonts

My question is about how PDF viewers handle fonts used in a PDF that are not embedded.
I'm using software (pdfjs-dist) to generate thumbnails from PDF's and noticed that text is often missing in the resulting image.
Upon further inspection it turns out that fonts are missing on the OS (which is a node docker container (linux)).
Now, I have heard that it's possible to always generate a render from a PDF, using some sort of layer in the PDF that contains vectorized data which you can view,
even when the fonts are not embedded in the PDF nor available in the operating system.
Has anyone heard of this mechanism that can point me to its technical name?

How to convert an Enhanced Windows Metafile (emf) to a JPG or PNG without loosing quality?

I am using Tableau to do some data representations and the only good quality image export Tableau allows is *.emf
Unfortunately, the online tool I use to put the report together(Canva) does not support emf format.
When I convert the file to jpg or png, the quality is drastically reduced :(
How can I overcome this matter? I tried many things such as opening emf in Illustrator and saving back with CMYK colors and 300dpi and such. But nothing seems to keep the crisp quality of the original emf file.
User Friendly solution:
InkScape opens enhanced windows metafiles, and many other vector-graphical file formats.
It exports to png with choice for output's resolution
It is opensource and available for Linux, windows and Mac OS X.
It is a fact that Tableau's image export feature does not provide many options. In general when I need high quality images, I use one of the below methods depending on the quality I need and the tools available to me at that time:
Screenshot method: If you have a large screen, taking a screenshot directly from Tableau yields better images than the exported ones. If my viz is exported to web, I sometimes enlarge the graphic from my web browser and then take the screenshot.
Converting from PDF: Since PDF can contain vector objects, Tableau's PDF files are in high quality most of the times. If you cannot use these PDF files, you may try converting these files to PNG or JPG files using online or desktop tools. Here is an online tool you may use for this purpose, but be careful about your confidential files when using such online services :)
And there are more ways to convert from PDF but are usually more complicated since they contain some Photoshop steps. I am not sure whether these are easy to apply methods for a lot of files but still you may want to check one of them: https://community.tableau.com/thread/120134

How can I find and extract an image from inside a proprietary file format?

I have cached preview files from Capture One (a photo processing program, similar to Lightroom) where I have lost the originals. Capture One saves previews in their proprietary .cop format and I'm not sure how to go about identifying what's what in there.
There are the strings ETIFFTagInteropIFD and JPEG Embedded TIFF Tags seen in the HEX view which suggests that they are somehow embedding a TIFF in there.
I do have original JPEG files with their corresponding COP-file, but when comparing them there isn't much that's similar - which makes sense I guess, since the preview COP-file is roughly half the size of the original.
What conclusions can I draw from this and what are some good tools for going further?

How to extract metadata and structure from Fireworks PNG files for conversion?

Since Adobe has declared Fireworks dead, it is apparent that many of us are potentially locked into Fireworks in terms of the proprietary layered PNG format that they have used. I have been hunting for options to extract / convert my documents over to either PSD's or some other layered SVG structure (perhaps similar to what Sketch does on OS X).
Anyone have any ideas for extracting the contents of Fireworks' PNGs programmatically? So far I haven't seen any libraries to make this feasible and really no discussion of how the metadata is structured in a Fireworks PNG in a format that would help to reverse engineer this format for proper conversion and extraction.

webcam with MJPG image format

I'm working with C# and a usb webcam that supports YUY2 or MJPG image formats. Thus far I've always had it in YUY2 mode and that works fine. Recently I tried changing the format to MJPG thinking that it would then feed my program one JPEG image per frame capture. It appears to almost do that. When I try to display the buffer, my app always takes an exception which is vague, but seems to indicate that the stream is invalid. I then copied one of the buffers to a file and tried to view it with IrfanView and it tells me that there is no huffman table. Looking at the buffer with a binary editor, I see it does have the SOI and EOF JPEG markers (and several others); however, it doesn't contain a huffman table marker. Any ideas what I'm doing wrong here? I've read a bit about JPEG and apparently there are cases where images can use a standard huffman table to reduce file size; however, if that's the case, how do I insert this into the image (if appropriate)?
This is with reference to Microsoft Lifecam by the way.
Part of the Motion-JPEG standard for AVI files is that a fixed Huffman table will be used so that it doesn't have to be stored in every frame.

Resources