I'm attempting to print SVG charts exported from HighCharts using the SDL product XPP which is an automated page composition engine. XPP is refusing to render the SVG graphics due to errors in the SVG files. I quote from their support team:
The problem with the SVG image that was sent to us is that it did not
comply with our requirements in support of SVG images,
On page 16-26 of the Managing XPP manual, we state:
SVG Document Structure
An SVG document must have XML and document type declarations. A
document or document fragment must have an root element. The
root element must define the svg namespace, and can contain text,
shapes,and paths.
What we have found in the SVG image provided, is there is no XML doc
type declaration as required.
As soon as I edited the SVG image, added such a doc type declaration,
and saved it, when I opened the SVG image in XPP, it converted and
displayed.
Would it be possible to have the Highcharts-Export server add the required XML and DTD declarations at the top of exported SVG files? I of course could add these in a post-processing step, but that does add complexity to our publishing pipeline.
On a possibly related note, I've found that the latest version of ImageMagick 6.8.5 also doesn't render the exported HighChart SVG correctly. Inkscape 0.48+ and various browsers (Chrome, Firefox, IE) seem OK with the files though.
Thanks
I'm not sure what the implications of this change could be really. But I've to admit that it sounds logical, to have the xml doc declaration at the start of the file. After all it's a FILE download.
In your case, this should be added;
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
I created an issue on GitHub for this
Related
Sending email using Editable Email Notification plugin in Jenkins
Following is the complete folder structure of the index.html file contains folders related to CCS, styling and images for the html page.
After receiving a mail- email is not loading image and css contents in email body.
Not sure how it will get reference to CSS, image and other stylings
For emails to work the CSS has to in-lined first, there are some email clients that don't read CSS in the head of the document.
Here are three resources you can use to inline your CSS:
PutsMail (litmus powered)
CSS Inliner Tool
CSS inliner
Note in order to use these your CSS has to be in the head of the document or it will not work.
That covers the CSS part, now the images. The images have to be loaded to a server and an absolute path has to be referenced in the HTML. If there is a relative path those images will not load.
Let me know if you have any questions.
I have been working on creating Epub for my work. I have used Aspose to create the Epub. In this process numerous word document is merged together and single epub file is created. Now I am asked to create an EPub based on a template. I have been searching a way to do it but I am no where near to the solution. I haven't even found the template for Epub which will render smoothly over various devices IOS and android. Similarly I have no clue how I will achieve this task programmatically. If anyone out there have any idea please provide me an insight.
As you may know an ePub is a file that contains a lot of html pages. if you want to create a template based epub programmatically you should link this files to a css and modify the structure of the html as the template.
If I were you I would use a regex to edit the html files, get the contents and place this contents in a new html page. Once done that I would place the html page in the epub.
I suggest you please create the template document (DOTX) using MS Word. Import this template document into Aspose.Words' DOM, merge Word documents, do other document processing tasks, and save it to EPUB using Document.Save method. You may also create the template document programmatically using Aspose.Words. I work with Aspose as Developer evangelist.
Is there a way for my designer to create an Adobe Illustrator export or particular file type that can contain variable substitution so images or text within the template image can be replaced at runtime to generate new png's for a website?
Once I have the template I want to bind data at the time of request to generate a new image.
The solution is to use Adobe Scene 7 with Illustrator to upload / convert .ai files into .fxg which parameterizes any layer / object in Illustrator art and allows you to modify the items at runtime via an addressable URL. This is a paid service, but I imagine slimmed down version of this could be accomplished using an SVG implementation.
I have an SVG file that I would like to display via Raphael (each svg file is a node in a tree I'm trying to draw, the actual connections of the tree will be made by raphael). I tried something like:
var vector_image = paper.image("test.svg", 50,50,50,50);
but no dice, seems only "real" image files like png or jpeg are accepted? I find this very strange as Raphael itself uses Scalable Vector Graphics.
Is there anyway (short of parsing the SVG files into javascript snippets and pasting them into the html document) to display existing SVG files using Raphael (or any other vector based javascript graphical engine?)
If parsing it will have to be, is there any easy way to do this, short of just manually scraping the files? I'm running this code on a Ruby on Rails server, so I'd like to avoid solutions outside this framework, if possible (I've heard of one PHP solution through this site...I'd rather code by hand than add another language onto this project).
-Jenny
It's currently not possible to display existing SVG with Raphael, and there are apparently no plans for the implementation of SVG editing (see this forum post).
As for alternative JavaScript libraries, a newer alternative is Snap.svg, which can load external SVG files via its Snap.load() function.
Is it possible to search "words" in pdf files with delphi?
I have code with which I can search in many others files like (exe, dll, txt) but it doesn't work with pdf files.
It depends on the structure of the specific PDF.
If the pdf is made of images (scanned pages) then you have to OCR each image and build a full text index inside the PDF. (To see if its image based, open it with notepad and look for obj tags full of random chars). There are a few utilities and apps that do this kind of work for you, CVision PDF Compressor is one that I have used before.
If the pdf is a standard PDF, then you should be able to open it like any other text file and search for the words.
Here is page that will detail some of the structure of a PDF. This a SO post for the same.
The components/libraries mentioned in the answer to this question should do what you need.
I'm just working on a project that does this. The method I use is to convert the PDF file to plain text (with pdftotext.exe) and create an index on the resulting text. We do the same with word and other office files, works pretty good!
Searching directly into pdf files from Delphi (without external app) is more difficult I think. If you find anything, please update here as I would also be very interested in that!
One option I have used is to use Microsoft's ifilter technology, this is used by windows desktop search and many other products such as sharepoint and SQL server full-text search.
It supports almost any office/office-like file format, even dwg, msg, pdf, and files in zip/rar archives.
The easiest way to use it is to run FiltDump.exe on any files you have, and index the text output.
To know about the filters installed on your PC, you can use ifilter explorer.
Wikipedia has some links on its ifilters page.
Quick PDF Library's GetPageText function can give you the words from a PDF as well as the page number and the co-ordinates of those words - sometimes useful for highlighting.
PDF is not just a binary representation. Think of it as a tree of objects, where an object node has some metadata and some content information. Some of these objects have string data, some don't. Some of these are even encrypted, and some are compressed. So, there's very little chance your string finder will work on any arbitrary PDF.