Failed to Load Requested File

Asked by Jefferson Jackson

I started my svg file by opening and embedding a PDF file. Earlier today I worked on it in Inkscape for a number of hours, saving a few times. Now, I'm receiving the dreaded "Failed to Load Requested File" error. Can anyone look over the xml of this svg file and see there are any glaring issues?

https://www.dropbox.com/s/tegfl0w0g28pquq/M201-LOADS%201ST%20FLOOR%20PLAN%20-%20Drawing.svg

Any help is much appreciated. I'd really like to not lose half-a-days work.

Question information

Language:
English Edit question
Status:
Solved
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Solved by:
Jefferson Jackson
Solved:
Last query:
Last reply:
Revision history for this message
su_v (suv-lp) said :
#1

The first error from Inkscape 0.48.x is:
/path/to/M201-LOADS 1ST FLOOR PLAN - Drawing.svg:4471: parser error : Excessive depth in document: 256 use XML_PARSE_HUGE option

This is a known issue still present in current stable versions (0.48.x), which is tracked in
Bug #297070 “depth of xmlParserMaxDepth insufficient”
<https://bugs.launchpad.net/inkscape/+bug/297070>
and fixed in the development branch of Inkscape.

A recent development build, which has this bug fixed, fails to open the original file with this error:

/path/to/M201-LOADS 1ST FLOOR PLAN - Drawing.svg:86534: parser error : Opening and ending tag mismatch: svg line 4 and g
</g>
    ^
/path/to/M201-LOADS 1ST FLOOR PLAN - Drawing.svg:86535: parser error : Extra content at the end of the document
</svg>
^

After removing the excessive </g> (closing tag for a group) at the bottom of the file, it opens ok in the development version, but very slowly, and is not really editable in a timely fashion (slow performance), mostly due to
a) a known performance regression with the new renderer in the development branch when rendering and editing drawings containing lots of stroked paths, and
b) the current structure resulting from PDF files imported into a single layer, mixed with thousands of objects (mostly nested groups with a single path deep inside) on the same layer. Using layers to split the drawing content would allow to selectively hide parts of the drawing, which can improve performance for rendering and editing a lot.

Me thinks that a real CAD application might be better suited for your needs, but I'll give it another try if I manage to figure out a way how to detect and ungroup some of those excessively nested groups which prevent the file from reopening in the current stable version (0.48.x) - several tries already failed and crashed inkscape.

Revision history for this message
su_v (suv-lp) said :
#2

Here's an edited version of the file which opens in Inkscape 0.48.x:

<http://dl.dropbox.com/u/65084033/answers/M201-LOADS%201ST%20FLOOR%20PLAN%20-%20Drawing-ungrouped.svg>

Edits done:
Pulling all paths out of the deeply nested group structures, getting rid of empty groups.

Since I'm not familiar with the project, the paths are now on different layers based approximately on the stroke width.

Revision history for this message
Jefferson Jackson (jacksonesquire) said :
#3

Wow! You're a savior. I imagine most of the nested group structures were from the imported PDF. Did you just edit the code directly or is there something in Inkscape (developer version obviously) that you did?

I've actually got AutoCAD but Inkscape is infinitely quicker for what I'm doing. Plus, not doing it in CAD removes some liability from me when I send it to clients (who would just import straight into AutoCAD if they could).

Revision history for this message
su_v (suv-lp) said :
#4

> I imagine most of the nested group structures were from the imported PDF.

Yes - AFAICT it partially depends on the original structure of the PDF, on poppler/cairo (external libraries used by Inkscape for the conversion of PDF files into an SVG structure) and of course on the internal routines of Inkscape (I sometimes wonder if it wouldn't be possible to prune such nested levels of container elements automatically (or optionally) on import if they do not add additional information (styles, transforms, clips or masks, etc)).

> Did you just edit the code directly or is there something
> in Inkscape (developer version obviously) that you did?

Neither - I used built-in commands which are available in stable and development builds (I only resorted to the development build because of the initial error about "Excessive depth in document: 256 …").

To extract paths (or other known object types) out of (deeply nested) groups, you can use 'Edit > Find…' [1]:
1) open 'Edit > Find'
2) Deactivate '[x] All Types'
3) In the detailed list of types which then opens, only select '[x] Paths'
4) narrow the search context (e.g. to current layer)
5) click on 'Find' to get a selection of paths only
6) return focus back to the main document window (take care to not lose the selection)
7) group the current selection (Ctrl+G)
-> this will pull all paths out of their individual nested group containers and put them into a single group
8) move the newly created group to a layer above or below (Shift + PageUp | PageDown)
9) ungroup it (Ctrl+U)
-> you have a separate layer containing only the paths, at the top-level (no more nested containers)

I had to repeat this in several smaller steps (due to the number of objects and levels of nested groups) - to prevent random crashes, and I used temporary new layers to isolate portions of the drawing to ease the process and be able to clean the empty groups left behind by extracting and moving the the path objects only.

Note: these steps might not work as is on other PDF imports: they ignore any masks or clip-paths applied to a group somewhere inside those nested levels, and basically release them all (without purging the original masks and clip-paths). It seems to be fine with PDF files generated by CAD applications from 2d line drawings (like e.g. floor plans) though.

hth, ~suv

P.S. Please let me know if you would prefer me to delete the modified version of your file from the public dropbox folder.

--
[1] <http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Select.html#Select-Find>
   <http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Groups.html>
   <http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Layers.html>