Patterns and pdf

General discussions about Inkscape.
erik
Posts: 6
Joined: Wed Sep 26, 2007 10:43 am

Patterns and pdf

Postby erik » Wed Sep 26, 2007 2:44 pm

I am using Win2000 and Inkscape (build 070922)

The new pdf capability of Inkscape is exciting and works extremely well. Especially since the pdf appears to be a vector one with no rasterisation visible. However, I have found that it does not work with patterns. I would love to be proved wrong and it may be simply an Inkscape setting that is incorrect but I have spent several hours on this.

I make cave maps and a friend who also uses Inkscape first noted that patterns disappear when the pdf is saved. The patterns are for sand or gravel etc and are simply a small group of maybe nine circles.

The svg result in Inkscape is perfect.
Save to Cairo pdf and then view in Adobe Reader and there is no pattern.
Opening the svg file in Scribus results in Scribus finding some unsupported features with it but it does open. The pattern has gone.
This may be relevant because Scribus appears to save pdfs in vector format.

Saving to pdf from Inkscape using pdf printer drivers results in saving the pattern but the pdf is rasterised. For example, PrimoDF gives a good result but still not in vector form.

A workaround is to use the "Stamping" function of Inkscape.

I also noted several times that the pattern fill became black in Inkscape. This may be related but I have not tried to nail the precise conditions when it happens.

If anyone has found these problems I would be interested in knowing if they have found a solution.

Erik

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Patterns and pdf

Postby microUgly » Wed Sep 26, 2007 4:26 pm

I seen your post on the mailing list. The best people to comment on this would probably be the developers, but I kinda assumed most developers would watch the user list also and I see you haven't received a satisfactory response.

I'm not a developer, but I wouldn't think there is an issue with the SVG itself, even if Scribus doesn't open the file properly. I assume this because pattern fill has been around a long time. I dare say it's a limitation of Scribus and Cairo to handle pattern fills. You may find Scribus uses Cairo to render the page (it's an option) which is why your seeing consistent behaviour between the two.

If you really wanted an answer, you could ask the Cairo developers. I did a search and found comments about issues with patterns, but not something specific enough to know if it's the same issue you are having.

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Patterns and pdf

Postby microUgly » Wed Sep 26, 2007 4:42 pm

Actaully, depending on your map, one work around might be to use "Create tiled clone" to create a limited sized area of the circles, group them, and then clip it with the object you want to fill - you just need to make sure the area of circles is big enough to fill it. It will look just like a pattern but isn't as simple to apply. The only catch is if you need to have a stroke effect also, in which case you can create a clone of the object being used as a clip and give it a stroke style.

erik
Posts: 6
Joined: Wed Sep 26, 2007 10:43 am

Re: Patterns and pdf

Postby erik » Wed Sep 26, 2007 5:09 pm

Thanks micrUgly,
My first attempt looked as if it was going to be successful. I made the cloned area to be a simple rectangle of coloured dots. Then did a clipview with a circle. All looked good. Then did a pdf and the pdf threw away the circle and left the rectangle of dots. Bummer. One good thing though, the rectangle of dots is still vector. Now, how to retain the clipview???? I tried grouping the clipview again to get a group of 1. Still no joy.
Erik

Simarilius
Posts: 626
Joined: Wed Jun 06, 2007 2:37 am

Re: Patterns and pdf

Postby Simarilius » Thu Sep 27, 2007 3:44 am

unfortunately I think clipping is one of the other areas we currently have issues with...
You could try using a mask, no idea if they work any better.

With regards to if the SVG is valid, the best benchmark for that tends to be batik, we generally use that as a are we doing it right test, as they have about the most complete implementation of the spec around.

erik
Posts: 6
Joined: Wed Sep 26, 2007 10:43 am

Re: Patterns and pdf

Postby erik » Fri Sep 28, 2007 9:21 am

OK. I have chased up pdf and patterns in old posts of the developers list and around June 2007 it was noted that Cairo pdf does not support patterns, masking or clipview. So I guess someone is working on it...hopefully.

In the meantime I have worked a bit more on the clone idea and have combined that with path exclusion to produce the desired result of a pattern that can be saved as a vector pdf. The steps are

1. Create the group that you want to use for a pattern. I used a group of five small circles.
2. Create a tiled clone. I created a 20 by 20 clone.
3. Scale this to cover the area of your drawing that will have the patterned section in it.
4. Create a white rectangle overlying the clones.
5. Create the areas that you want to have patterns and then do a path exclusion on them and the white layer. This creates holes in the white layer and the pattern shows through.
6. Save as Cairo pdf. The result is a pattern that goes into the pdf as a vector.

To test on a real case, I went into a complex cave map with seven layers and did the above steps all in an eighth layer below the others. The method works very well and the pdf now shows the pattern. There will still be cleaning up to do to this map to remove residual bits and pieces from the earlier work but it should be quite straightforward to use the technique on a new map.

Erik

isaacc

Re: Patterns and pdf

Postby isaacc » Sat Aug 02, 2008 2:10 am

Or:

As a workaround, instead of saving using Inkscape's PDF (via Cairo). I printed the image to a virtual PDF printer. In my case, I have installed CutePDF. CutePDF didn't have a problem with the patterns.
.

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Patterns and pdf

Postby microUgly » Sun Aug 03, 2008 11:37 am

isaacc wrote:As a workaround, instead of saving using Inkscape's PDF (via Cairo). I printed the image to a virtual PDF printer. In my case, I have installed CutePDF. CutePDF didn't have a problem with the patterns.

Correct me if I'm wrong, but using a PDF printer won't preserve the vector data--it rasterises the image.


Return to “General Discussions”