Forum How do I...?

Getting wrong page measurement in PDF output.

Balaa
Hi,

I have set the below page margin value in CSS. But, I have not get the correct measurement in PDF output (please see the attached image file).

CSS
@page { size: 155mm 235mm;}


Thanks,
Bala
  1. Page_measurement.png278.8 kB
mikeday
This issue should be fixed in Prince latest builds.
Balaa
Thanks Now it's shows correctly.

One more thing. I have set margin top value 2.2cm for text area. But, the output PDF shows the 2.34 cm. Please check and let me know the reason.

CSS:
@page:first{margin: 2.2cm 1.9cm 2.44cm 1.9cm;}

Please find the attached image file.

Thanks,
Bala
  1. Sample1.png298.7 kB
Balaa
One more question.
Is there any possibilities to include the line numbers in the output PDF file through CSS file? Because, I need to set the abstract content 12 lines down from the top type area. It's too difficult to identify the lines.

Thanks,
Bala
Balaa
How I can adjust the word spacing for 8th line in a paragraph?
mikeday
Currently it is not possible to change the style of specific numbered lines with CSS, only some aspects of the ::first-line can be changed.
Balaa
Hi Mike,

Could you please send reply for above queries.

thanks,
Bala
mikeday
To measure the margin-top it will be easier if you add a background to the page area and the text, eg.
@page { background: blue }
h1 { background: red }]

This will show the areas more precisely.
Balaa
Hi Mike,

One more thing. I have set margin top value 2.2cm for text area. But, the output PDF shows the 2.34 cm. Please check and let me know the reason.

CSS:
@page:first{margin: 2.2cm 1.9cm 2.44cm 1.9cm;}

Please find the attached image file.

Thanks,
Bala
  1. Sample1.png298.7 kB
mikeday
Can you try applying the @page and heading background as suggested? I am not sure how Acrobat is measuring these figures.
Balaa
Hi Mike,

I would like to paginate the both numbered and unnumbered heading levels in the single chapter. I have manipulate the below CSS properties. But, the output PDF contains numbered headings style for all headings.

CSS:
Numbered Headings
Section1 { counter-increment: section-1; }
Section2 { counter-increment: section-2; }
Section3 { counter-increment: section-3; }
Section4 { counter-increment: section-4; }
Section5 { counter-increment: section-5; }
Section1 > Heading:before { content: counter(section-1);padding-right:11pt;}
Section2 > Heading:before { content: counter(section-1)"."counter(section-2);padding-right:11pt;}
Section3 > Heading:before { content: counter(section-1)"."counter(section-2)"."counter(section-3);padding-right:11pt;}
Section4 > Heading:before { content: counter(section-1)"."counter(section-2)"."counter(section-3)"."counter(section-4);padding-right:11pt;}
Section5 > Heading:before { content: counter(section-1)"."counter(section-2)"."counter(section-3)"."counter(section-4)"."counter(section-5);padding-right:11pt;}

Unnumbered Headings:
Section1#Sec1a > Heading:before {content: normal}
Section2#Sec1b > Heading:before {content: normal}
Section3#Sec1c > Heading:before {content: normal}

Thanks,
Bala
mikeday
Do you want to disable counter-increment for the unnumbered headings?
Balaa
Yes
mikeday
You can add rules to say "counter-increment: none" for these elements.
Balaa
I have tried, but it's not working.
Balaa
Thanks Mike,

It's working fine using below method in CSS.

Section1[ID="Sec1a"] > Heading:before {content: normal;}
Section2[ID="Sec1b"] > Heading:before {content: normal;}
Section3[ID="Sec1c"] > Heading:before {content: normal;}