https://github.com/tb/pdf_latex
complile PDFs and do all kind of DTP tricks with LaTeX
https://github.com/tb/pdf_latex
Last synced: over 1 year ago
JSON representation
complile PDFs and do all kind of DTP tricks with LaTeX
- Host: GitHub
- URL: https://github.com/tb/pdf_latex
- Owner: tb
- License: mit
- Created: 2012-09-12T14:46:49.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2012-10-04T11:58:34.000Z (over 13 years ago)
- Last Synced: 2025-02-09T17:17:51.805Z (over 1 year ago)
- Language: Ruby
- Size: 242 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- License: MIT-LICENSE
Awesome Lists containing this project
README
= pdf_latex
Wrapper around pdflatex that helps to complile PDFs and do all kind of DTP tricks with LaTeX.
It can be used in Rails together with wicked_pdf.
=== Gemfile
gem 'pdf_latex', :git => 'git@github.com:tb/pdf_latex.git'
== Usage sample
Below you can see controller code that builds PDF compiled of many wicked_pdf PDFs renderings.
Cover can be horizontal PDF and content can be landscape.
Compiled PDF is build based on LaTeX file that should be located at #{Rails.root}/lib/latex/workbook.tex
See also http://github.com/tb/pdf_latex/tree/master/example for LaTeX example.
class Elearning::Pdf::WorkbookController < Elearning::Pdf::ApplicationController
def show
pdf = PdfLatex.new('workbook').render_to_string({
:cover => "http://#{request.host_with_port}/pdf/workbook/cover",
:content => "http://#{request.host_with_port}/pdf/workbook/content"
})
send_data pdf, :filename => 'workbook.pdf', :type => 'application/pdf'
end
end
== Installing pdflatex in Ubuntu
apt-get install texlive-latex-base texlive-latex-recommended texlive-fonts-recommended
== Contributing to pdf_latex
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
* Fork the project.
* Start a feature/bugfix branch.
* Commit and push until you are happy with your contribution.
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
== Copyright
Copyright (c) 2012 Tomasz Bak. See MIT-LICENSE for further details.