Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Improve Prawn support #19

Merged
merged 4 commits into from Oct 24, 2012

Conversation

Projects
None yet
3 participants
Contributor

jhadvig commented Oct 2, 2012

Improved PDF generation with Prawn due to problem with datatypes (e.g TimeWithZone).
Now all datatypes are converted into String before the PDF is generated.
Also added example file pdf_table_prawn.rb for demonstrating how to generate PDF
with Prawn. Now there is one hash which stores all the configuration options
using Prawn API.

Also fixed some minor stuff in two examples.

jhadvig added some commits Oct 2, 2012

@jhadvig jhadvig Improve Prawn support
Improved PDF generation with Prawn due to problem with datatypes (e.g TimeWithZone).
Now all datatypes are converted into String before the PDF is generated.
Also added example file pdf_table_prawn.rb for demonstrating how to generate PDF
with Prawn. Now there is one hash which stores all the configuration options
using Prawn API.
b4e2cba
@jhadvig jhadvig Examples fix b668e68

@Odaeus Odaeus commented on an outdated diff Oct 3, 2012

lib/ruport/formatter/pdf.rb
@@ -276,6 +276,7 @@ def pad_bottom(y,&block)
#
# http://stonecode.svnrepository.com/ruport/trac.cgi/wiki/PdfWriterQuickRef
def draw_table(table_data, format_opts={})
+
@Odaeus

Odaeus Oct 3, 2012

Collaborator

I don't think it's common Ruby style to have newlines immediately after method definitions?

@Odaeus Odaeus commented on an outdated diff Oct 3, 2012

lib/ruport/formatter/prawn_pdf.rb
@@ -16,16 +16,30 @@ def initialize
end
def pdf
- @pdf ||= (options.formatter || ::Prawn::Document.new())
+ @pdf ||= (options.formatter ||
+ ::Prawn::Document.new(options[:pdf_format] || {:page_size => "LETTER",
@Odaeus

Odaeus Oct 3, 2012

Collaborator

Prawn's docs seem to indicate it already defaults to the Letter page size (the global standard is A4 but that's a different matter entirely :)). Is there a particular reason you specify them again as defaults here?

Collaborator

Odaeus commented Oct 3, 2012

Thanks very much for your contribution! Please just have a look at the couple of issues I raise and let me know what you think.

@jhadvig jhadvig Refactoring code
Cleaning up some parts of code on the suggestion of Odaeus.
03f29f3
Contributor

jhadvig commented Oct 4, 2012

Ok I've looked on it and cleaned up the code. I've also test it on some cases and it should be running :).

@jhadvig jhadvig Fix in the format hash
Fixed one last mistake in the code
51566d1
Contributor

jhadvig commented Oct 16, 2012

Hi Odaeus,
could you please express yourself whether there should be some changes made in the code so it could be merged with the upstream.
Thanks,
Jakub

iNecas commented Oct 24, 2012

Is there something that block this one to get in? It's really helpful going toward 1.9 support.

@Odaeus Odaeus added a commit that referenced this pull request Oct 24, 2012

@Odaeus Odaeus Merge pull request #19 from jhadvig/prawn_integration
Improve Prawn support
843fbf6

@Odaeus Odaeus merged commit 843fbf6 into ruport:master Oct 24, 2012

Collaborator

Odaeus commented Oct 24, 2012

Sorry for the delay on this. I'll update the gem shortly, just want to see if anything else should go in as well.

iNecas commented Oct 24, 2012

Thats a great news, @Odaeus thanks!

Contributor

jhadvig commented Oct 25, 2012

Thank you very much @Odaeus. Looking forward for the gem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment