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

Write() doesn't work properly for non-newline terminated strings. #1

Open
GoogleCodeExporter opened this issue Apr 15, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

For a trivial program using Write() without a trailing newline:

            auto pdf = boost::shared_ptr<FPDF>(new FPDF());
            pdf->AddPage();
            pdf->SetFont("Arial","B",16);
            //pdf->Cell(40,10,"Hello World!");
            pdf->Write(5,"Hello World!");

The output file is blank instead of the appropriate 'Hello World' text.

I believe there's a typo in fpdf.zz, line 1581.  The line currently says:

            stmp = s.substr(j, j);

But this results in an incorrect length for the substring.  I think the call 
should be:

            stmp = s.substr(j, i-j);

Original issue reported on code.google.com by aoren...@gmail.com on 23 May 2013 at 8:36

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

No branches or pull requests

1 participant