Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0a43a55
Showing
5 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source :rubygems | ||
|
||
gem 'prawn', '1.0.0.rc1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
Ascii85 (1.0.1) | ||
pdf-reader (0.10.1) | ||
Ascii85 (~> 1.0.0) | ||
prawn (1.0.0.rc1) | ||
pdf-reader (>= 0.9.0) | ||
ttfunk (~> 1.0.3) | ||
ttfunk (1.0.3) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
prawn (= 1.0.0.rc1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Printing a PDF as-is | ||
|
||
The PDF `margin-test.pdf` is A4 sized, with top and bottom margins of 15.3mm. You can see the Ruby code which generated it in `pdfer.rb`. | ||
|
||
I need to print this PDF as-is on A4 paper. It has to be as-is because I'm printing sticky labels and they need to align. | ||
|
||
When I view the PDF on screen (in Preview) at 100%, it displays correctly. I can measure the margins and verify they are correct. | ||
|
||
But when I print it the box is not centred vertically: the top margin differs from the bottom margin. I have fiddled with the scale settings in the print dialog but to no avail. | ||
|
||
It must be possible to print at 100%...can anyone enlighten me? | ||
|
||
Thanks, | ||
|
||
Andy Stewart | ||
boss@airbladesoftware.com |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require 'rubygems' | ||
require 'prawn' | ||
require 'prawn/measurement_extensions' | ||
|
||
doc = Prawn::Document.new :page_size => 'A4', | ||
:left_margin => 7.21.mm, | ||
:right_margin => 7.21.mm, | ||
:top_margin => 15.3.mm, | ||
:bottom_margin => 15.3.mm | ||
doc.stroke_bounds | ||
doc.render_file 'margin-test.pdf' |