Using whole space of pdf file

I am using prawn to create pdf file but it always leaves some spaces/margins around the page. Can't we use whole space of the pdf file not leaving any margins around?

Thanks !!!

Answers


Are you referring to the page bounds ?

The general space that is consumed on the page can be shown by the example code:

require 'prawn/core'
require 'prawn/layout'

Prawn::Document.generate('padded_box.pdf') do
  stroke_bounds
  text "Margin box"
  padded_box(25) do
    stroke_bounds
    text "Bounding box padded by 25 on all sides from the margins"
    padded_box(50) do
      stroke_bounds
      text "Bounding box padded by 50 on all sides from the parent bounds"
    end
  end
end

This will draw the bounds of the page showing the margin. There is a gap, which is the margins typically defined for the printing area


Need Your Help

How to use boto's s3 bucket.copy_key with KMS SSE?

amazon-web-services encryption amazon-s3 boto aws-kms

I am using boto version 2.38.0 in an attempt to do a region-to-region copy of a key on s3 to the same key in a different bucket that is in a different region. The source key is encrypted using a KMS

Java EE Enterprise Application: perform some action on deploy/startup

java deployment java-ee entity startup

I would like to perform some action as soon as my application (Enterprise Application with Business Logic, EJB, and a Client, Web) is deployed.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.