Welcome Guest, Not a member yet? Register   Sign In
Empty inline pdf
#1

[eluser]Geoffrey[/eluser]
I have some code that successfully generates a dynamic pdf from session data using tcpdf as an include rather than a plugin or library.

When I try to output the pdf inline ($pdf->Output("filename.pdf","I")Wink I get a blank pdf. If I change the Output command to download instead ($pdf->Output("filename.pdf","D")Wink, the pdf that is downloaded has all the information I require in it.

Interestingly, the problem with inline pdfs only happens if I have the Adobe PDF plugin (8 or 9) enabled for my browser (Safari in OS X 15.5.5). If I disable the Adobe PDF and use Safari's native pdf support, everything works fine for inline pdfs.

It never popped up as a bug for me as traditionally I don't use the Adobe PDF plugin but some of my testers in IE7 reported the issue.

Thoughts/suggestions?

My leaning is towards some sort of session problem as I had a redirect that went back to the form if 2 of the session variables were empty which I had to turn off for debugging this issue.
#2

[eluser]Geoffrey[/eluser]
It doesn't appear to be a tcpdf issue as the problem exists in another codeigniter project I've done that uses fpdf. This second project is using CI 1.6.3 rather than 1.7.0 when I first encountered the issue.

Looking at the database where I am storing the session data, it seems that when Acrobat loads the pdf, a new session id is being generated in the Db with no user_data and as such, the pdf is empty. The original session is still there with the user_data I need but I can't get to it.

How do I stop a new session being initiated and get it to use the existing session?
#3

[eluser]Geoffrey[/eluser]
Problem solved for now. Used the Native Session library from the wiki.

Still would've been nice to be able to have used the builtin session handling capabilities of CI.




Theme © iAndrew 2016 - Forum software by © MyBB