Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font help/issues generating PDF from ckeditor html #22

Open
pds-nmsu opened this issue Jan 29, 2014 · 0 comments
Open

Font help/issues generating PDF from ckeditor html #22

pds-nmsu opened this issue Jan 29, 2014 · 0 comments

Comments

@pds-nmsu
Copy link

Hello Igor,

wisepdf has worked great for us but I have a font issue and I'm not sure if I have something misconfigured or this is a bug but here goes:

We have embedded ckeditor in a client app for generating templates. The html produced from the ckeditor is merged with data and then put through wisepdf and sent to the browser in a controller.

But the font within the generated PDF output is always Liberation; regardless what was specified inside ckeditor (and ultimately embedded in the inline html.)

Ckeditor includes a content.css file with a font-size: 12px within the body tag so I was at least expecting my PDF font sizes to be the same but they are always a non integer and usually 12.28.

Html tags with a specific font and font size assigned to them also output Liberation with a non integer font size.

Here is a sample of how ckeditor embeds font style and font size:

<p>
    <span style="font-family:times new roman,times,serif;">
        <span style="font-size: 12px;">
            Times New Roman
        </span>
    </span>
</p>

Should I expect wisepdf to embed the above with Times New Roman with a 12px font size? I'm analysing the PDF output using Acrobat.

My wisepdf gem version is 1.3.1. Here is my wisepdf controller set up:

pdf = Wisepdf::Writer.new.to_pdf(ckeditor_html,
    :page_size => 'Legal',
    :save_to_file => letter_template_name+'.pdf')
send_data pdf, type: 'application/pdf', disposition: 'inline'

Sorry for the long winded question. ;)

Thanks,
Joe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant