Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #26377

    In my project, i have to generate several PDF-pages from different URLs for a report.

    Each URL has a pretty big CSS include, but it’s always the same one. As i get a parse error (Invalid syntax in CSS declaration. “filter:”), i see that the CSS-parser parses each of these CSS-files individually. And thats why it takes ages to render the whole report.

    Is there a way to tell the parser to cache the parsed CSS contents?

    Thanks,
    Franz

    #27984

    Actually PD4ML caches CSS documents in parsed form, but, you are right, it does not cache CSS documents failed to parse. I’ve added the feature request to our TODO list.

    I do not believe you use CSS stylesheets, greater than 1 Mb in size. Otherwise it should not tangible impact HTML-to-PDF conversion performance.

    Well, the best solution would be to support the notorious “filter:” properties – we need to check the actual state of CSS Parser project and adapt our library to it (if it already supports the syntax).

    #27985

    @PD4ML wrote:

    I do not believe you use CSS stylesheets, greater than 1 Mb in size. Otherwise it should not tangible impact HTML-to-PDF conversion performance.

    No, it’s ‘only’ about 120kb in size. Which is huge, but i cant change that.

    @PD4ML wrote:

    the best solution would be to support the notorious “filter:” properties

    That’d be awesome. We have to rely on that property to support IE6…

    Thanks for your efforts!

    #27986

    sorry for my logged-out reply…
    Well after some more discussion in our dev-team we may have an idea for a workaround.
    http://pd4ml.com/support/pdf-generation-troubleshooting-f4/prevent-images-being-scaled-t38.html
    Here it’s said, that “PD4ML ignores print CSS media type and respects only stylesheets defined for all, screen and proprietary pdf media types.”.
    So, if we find out what is meant by “proprietary pdf media type”, we could redefine the css-classes that use the “filter:” property in the appropriate media-type *not* to use the “filter:” property, and pd4ml should ignore the property.

    Right?
    Edit: –> Wrong: @media pdf {} would give the semantical possibility to override stuff, but the parser goes through all css, of course…

    #27987

    @media pdf {} is going to be interpreted only by PD4ML. So if you place the section after common CSS definitions, you may override them with PD4ML-specific ones.

    Of course it does not help to solve “filter:” issue. In theory you may screen some CSS style sections (and avoid the parsing errors) under media types, not known to or ignored by PD4ML: tv, print, projection, handheld etc. But it is difficult to say if the major browsers ignore or interpret them.

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.