Welcome Guest Search | Active Topics | Sign In | Register

Support for jquery mobile Options
Mike
Posted: Thursday, January 10, 2013 6:03:56 PM
Rank: Newbie
Groups: Member

Joined: 1/10/2013
Posts: 4
I'm trying to render a pdf of a page that uses jquery mobile. If I put the following script tag on the page, I get an empty pdf file. If I remove the script tag, the pdf renders the content but with out any of the jquery mobile formatting.

<script type="text/javascript" src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.js"></script>

Am I missing something???
eo_support
Posted: Thursday, January 10, 2013 6:52:08 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

You will want to verify your page with Google Chrome browser first. Our rendering is most close to Google Chrome browser. I am not exactly sure why you expect the PDF to have JQuery mobile formatting though. To your JavaScript code, our converter is a desktop browser.

Thanks!
Mike
Posted: Thursday, January 10, 2013 7:00:48 PM
Rank: Newbie
Groups: Member

Joined: 1/10/2013
Posts: 4
Here is the test page which reflects some of the content I want to put in a pdf.
https://mobilecentral.swyfthub.com/jquery/test.html

If I put this url in your demo page and convert it to a pdf, then content renders perfectly.

What I really want to do is generate some content similar to this html file, and generate the pdf using the following code. PresentmentContent contains the html. When I receive the pdf in an email with an attachment, the pdf is blank.

// create the attachment in memory
MemoryStream ms = new MemoryStream();
EO.Pdf.HtmlToPdf.Options.MinLoadWaitTime = 5000;
EO.Pdf.HtmlToPdfResult result1 = EO.Pdf.HtmlToPdf.ConvertHtml(PresentationContent, ms);
// the memorystream position must be set to
ms.Position = 0;
System.Net.Mail.Attachment attachment = new System.Net.Mail.Attachment(ms, DocumentName);

Interesting thing is that if I load the file using the page below and convert to pdf, I get an empty pdf file. The content of the loaded file is the same as the test.html from above.
http://www.essentialobjects.com/Products/EOPdf/FileToPdf.aspx

eo_support
Posted: Thursday, January 10, 2013 8:10:37 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

You need to set HtmlToPdf.Options.BaseUrl whenever you use ConvertHtml.

Thanks!
Mike
Posted: Thursday, January 10, 2013 8:38:40 PM
Rank: Newbie
Groups: Member

Joined: 1/10/2013
Posts: 4
Perfect! Thanks!
eo_support
Posted: Thursday, January 10, 2013 8:55:28 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Great. Please feel free to let us know if there is anything else.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.