Forum How do I...?

basic usage

Steffan
I am new to this tool. I've been searching for a replacement to HTMLDOC as the engine to a set of tags I wrote for Lasso (like php). I tried the tool from the latest download of prince but ran into an issue.

prince -i --baseurl <apple> -o ~/desktop/apple.pdf yields a whole slew of errors. I tried using also -input html to identify the incoming source then I get an error saysing no input documents to process. :(

I tried, so I thought every possible combination but no dice. Anyone have any experience using prince in this method?

-S
mikeday
Can you post the errors that you get, and perhaps email me (mikeday@yeslogic.com) a sample document?
Steffan
Here are a couple of the options I tried. This was on Mac OS X 10.4.10

Phat-G5:~/Desktop/prince-6.0r3-macosx steffan$ prince -input=html --baseurl='http://www.apple.com' -o ~/desktop/apple.pdf
prince: error: no input documents to process
Phat-G5:~/Desktop/prince-6.0r3-macosx steffan$ prince -i --baseurl='http://www.apple.com' -o ~/desktop/apple.pdf
prince: error: no input documents to process
Phat-G5:~/Desktop/prince-6.0r3-macosx steffan$ prince -i --baseurl http://www.apple.com -o ~/desktop/apple.pdf
prince: http://www.w3.org/TR/html4/loose.dtd:31: error: xmlParseEntityDecl: entity HTML.Version not terminated
prince: http://www.w3.org/TR/html4/loose.dtd:31: error: Content error in the external subset
prince: http://www.apple.com:38: error: Opening and ending tag mismatch: link line 23 and head
prince: http://www.apple.com:63: error: Opening and ending tag mismatch: input line 63 and label
prince: http://www.apple.com:64: error: Opening and ending tag mismatch: label line 63 and form
prince: http://www.apple.com:66: error: Opening and ending tag mismatch: form line 58 and div
prince: http://www.apple.com:106: error: Opening and ending tag mismatch: img line 106 and a
prince: http://www.apple.com:108: error: Opening and ending tag mismatch: img line 108 and a
prince: http://www.apple.com:109: error: Opening and ending tag mismatch: img line 109 and a
prince: http://www.apple.com:110: error: Opening and ending tag mismatch: a line 109 and div
prince: http://www.apple.com:111: error: Opening and ending tag mismatch: a line 108 and div
prince: http://www.apple.com:114: error: Attribute id redefined
prince: http://www.apple.com:118: error: Opening and ending tag mismatch: img line 118 and a
prince: http://www.apple.com:119: error: Opening and ending tag mismatch: img line 119 and a
prince: http://www.apple.com:120: error: Opening and ending tag mismatch: img line 120 and a
prince: http://www.apple.com:121: error: Opening and ending tag mismatch: img line 121 and a
prince: http://www.apple.com:122: error: Entity 'nbsp' not defined
prince: http://www.apple.com:123: error: Opening and ending tag mismatch: a line 121 and div
prince: http://www.apple.com:128: error: Entity 'nbsp' not defined
prince: http://www.apple.com:135: error: Specification mandate value for attribute selected
prince: http://www.apple.com:135: error: attributes construct error
prince: http://www.apple.com:135: error: Couldn't find end of Start Tag option line 135
prince: http://www.apple.com:135: error: Opening and ending tag mismatch: select line 134 and option
prince: http://www.apple.com:167: error: Opening and ending tag mismatch: form line 133 and select
prince: http://www.apple.com:168: error: Opening and ending tag mismatch: img line 132 and form
prince: http://www.apple.com:172: error: Opening and ending tag mismatch: img line 171 and body
prince: http://www.apple.com:173: error: Opening and ending tag mismatch: a line 120 and html
prince: http://www.apple.com:174: error: Premature end of data in tag a line 119
prince: http://www.apple.com:174: error: Premature end of data in tag a line 118
prince: http://www.apple.com:174: error: Premature end of data in tag div line 117
prince: http://www.apple.com:174: error: Premature end of data in tag div line 107
prince: http://www.apple.com:174: error: Premature end of data in tag a line 106
prince: http://www.apple.com:174: error: Premature end of data in tag div line 106
prince: http://www.apple.com:174: error: Premature end of data in tag div line 45
prince: http://www.apple.com:174: error: Premature end of data in tag body line 39
prince: http://www.apple.com:174: error: Premature end of data in tag link line 22
prince: http://www.apple.com:174: error: Premature end of data in tag meta line 14
prince: http://www.apple.com:174: error: Premature end of data in tag link line 13
prince: http://www.apple.com:174: error: Premature end of data in tag link line 12
prince: http://www.apple.com:174: error: Premature end of data in tag link line 11
prince: http://www.apple.com:174: error: Premature end of data in tag meta line 10
prince: http://www.apple.com:174: error: Premature end of data in tag meta line 9
prince: http://www.apple.com:174: error: Premature end of data in tag meta line 8
prince: http://www.apple.com:174: error: Premature end of data in tag meta line 7
prince: http://www.apple.com:174: error: Premature end of data in tag meta line 6
prince: http://www.apple.com:174: error: Premature end of data in tag meta line 5
prince: http://www.apple.com:174: error: Premature end of data in tag head line 3
prince: http://www.apple.com:174: error: Premature end of data in tag html line 2
prince: http://www.apple.com: error: could not load input file
prince: error: no input documents to process
Phat-G5:~/Desktop/prince-6.0r3-macosx steffan$
mikeday
Okay, the problem is the -i option with no argument, which is causing Prince to try and load the URL as XML and not HTML for some reason. Also, the --baseurl option should not be necessary in this case. Try this:
$ prince -o apple.pdf http://www.apple.com

You may want to increase the paper size:
@page { size: landscape }

Or enable shrink-to-fit:
@page { prince-shrink-to-fit: auto }

You can add one of these rules to an external style sheet, and use the --style command-line option to apply it.