Forum How do I...?

Viewing finished pdfs within Prince; css file trouble

alanl
I just downloaded 64-bit Prince onto a new machine. First time use of Prince 11. I usually use Prince 7 or so. Many changes.

Two things, immediately:

1) The option to VIEW the finished pdf appears to have gone away. Am I missing something? This is a very valuable feature; not to have to open and juggle a separate pdf viewer.

2) It does not like my old css code. I made things super-simple with the following input file and css file, but no go. I get an error message: "parse error in selector at '\1A'"

input file:

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="FOO.CSS" />
</head>
<body>
<p class="thisfont"> FOOBAR! </p>
</body>
</html>

css file (FOO.CSS):

p.thisfont { font-size: 1.0in }

...... what am I doing wrong?

I usually use "@import url" to include my css file, but I was just going by the prince documentation, section "Your First Document", which specifies the "link rel" method.

Sorry if this has been covered before or if it is "too basic" of a question. I DID read the prince documentation section on css files. Maybe I missed something.

Thanks in advance!

Alan

mikeday
Unfortunately embedding a PDF viewer in the Prince GUI has proven to be problematic, so yes it requires juggling a separate PDF viewer for now.

The CSS error messages looks like a character encoding problem, would you be able to attach the file here or email it to me (mikeday@yeslogic.com)
alanl
Thanks for your quick reply. The css file that I posted above is complete; i.e. it consists of the ONE line:

p.thisfont { font-size: 1.0in }

.... that's it. The whole file. Attached, also (foo.css).

  1. foo.css0.0 kB
mikeday
For some reason the file ends with an unusual byte, ASCII control character 1A.

If you trim this strange byte it should work fine; see attached.
  1. foo2.css0.0 kB
alanl
Thanks, Mike! I forgot about that end-of-file character that my editor inserts. The old Prince did not mind, but this one does. It works, now.

After a bit of effort I was able to correct the other errors in my css.

One more thing, however. In my multi-column definition, I used to use this line:
prince-hyphenate-patterns: url('C:\PROGRA~1\Prince\Engine\hyph\')
..... to invoke hyphenation. It does not work now. The hyphenation stuff is on a
different directory, program files (x86), but I don't know how to invoke that. I was
going to ask you for tips, but then I noticed that the hyphenation is DONE in the
finished pdf without that explicit call. Is that correct? No need for that call? If so,
a nice improvement!

The juggling of an external pdf viewer is no fun. For example, the
pdf must be explicitly released by the viewer before prince will re-generate the pdf; i.e.
more clicks, more little things to remember to do. Is there a 64-bit version of Prince
that has the built-in viewer? Version 8, or 9, or...?

Thanks!

dauwhe
It's probably impossibly naive, but a little something like

prince test.html && open test.pdf


seems to work for me in at least some shells :)
mikeday
There are also some other PDF viewers that may be worth a try, like FoxIt or mupdf.
markbrown
I forgot about that end-of-file character that my editor inserts. The old Prince did not mind, but this one does.


It's action is to just drop the offending character, so in this case it should have parsed the rest of the file successfully and the message is safe to ignore. We've added a '--no-warn-css' option to suppress such messages from the parser if they're not needed.

Thanks for the reminder that ^Z is still around!