Welcome Guest Search | Active Topics | Sign In | Register

ASPX to PDF (conflict with jquery and css) Options
GregB
Posted: Wednesday, November 9, 2011 11:50:50 AM
Rank: Newbie
Groups: Member

Joined: 11/9/2011
Posts: 6
Hello,

I am considering using your ASPX to PDF control but ran into few issues on my server. When I tried to use the control on my .aspx page I've noticed two things:

1. The page is no longer centered. The content is shifted to the left.
2. My stylesheet seem to be disabled. Fonts are not the same as on my orignal page.

So my first question is: does it matter where on the .aspx page I add the aspxtopdf control? i.e top bottom, etc. Also, I use reference to jquery files and I use javaScript in my page. Is there any conflict between your control and scripts?

Second question:

I was able to save the content of the .aspx page and the pdf seems to be ok very close to my .aspx page, but some text boxes that were blank are no longer showing next to each label tag. Because of that the pdf looks not even and you can easily tell that something is different.

Third Question:

Is there a way to save pdf and attach it to the e-mail so the pdf is ready to be send via e-mial?

BTW: I am running Windows 7 Enterprise, IE 9 on my dev box. On the server I have Windows 2008, IE 8. But the server and my dev box have the same behavior. If I remove the ASPXtoPdf control my page looks fine.

Thank you!

Greg
eo_support
Posted: Wednesday, November 9, 2011 1:07:33 PM
Rank: Administration
Groups: Administration

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

Aspxtopdf should work fine with jquery. It has a full browser engine. So it should handle js fine and it does not need your IE to work. Internally the control intercepts your page output and pass it to ConvertHtml, so it does not alter you page output either.

When you use jquery, you may want to try to increase HtmlToPdf.Options.MinLoadWaitTime. This value control the amount of time the converter wait before trying to convert to pdf. If it takes a while for your script to generate the final output and the converter kicks in before that, then you will not see the right result.

As to the layout problem, try to give you page a fix width. Because a standard paper size is much nafrower than the screen size, the converter will try to fit the page as narrow as possible, that can cause layout problem if your page does not "insist" a minimum width.

Hope this helps. Let us know if it works for you.

Thanks
Hanh Nguyen
Posted: Sunday, November 27, 2011 10:05:43 AM
Rank: Newbie
Groups: Member

Joined: 11/27/2011
Posts: 4
I use Google Chart API (http://code.google.com/apis/chart/interactive/docs/gallery.html). I increased MinLoadWaitTime but it did not work. I thought I did not correctly when set Options.Noscript=false. Please help me!!!
eo_support
Posted: Sunday, November 27, 2011 10:23:11 AM
Rank: Administration
Groups: Administration

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

Please try to create a test project demonstrating the problem and send it to us in zip format. We will PM you as where to send it.

Thanks
Hanh Nguyen
Posted: Sunday, November 27, 2011 11:49:49 AM
Rank: Newbie
Groups: Member

Joined: 11/27/2011
Posts: 4
I mailed to your Support Team. Pls help me :(
Here is download link : http://199.91.152.195/8b111p2rr2zg/klzelgeoto4lsxy/EODemo.rar
Hanh Nguyen
Posted: Sunday, November 27, 2011 2:44:31 PM
Rank: Newbie
Groups: Member

Joined: 11/27/2011
Posts: 4
I tried using HtmlToPdf.Options.VisibleElementIds = "idChart1;idChart2";
But only chart1 is visible. Help me!!!
eo_support
Posted: Monday, November 28, 2011 8:29:35 PM
Rank: Administration
Groups: Administration

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

We have posted a new build that may fix this problem. Please see your private message for the download location.

Thanks!
Hanh Nguyen
Posted: Tuesday, November 29, 2011 7:03:24 AM
Rank: Newbie
Groups: Member

Joined: 11/27/2011
Posts: 4
I used new build but server threw an exception : Object reference not set to an instance of an object.
P/s : I just deleted the old reference EO.Pdf.dll and added the new. (No change in my code).
Help me fix this problem!
eo_support
Posted: Tuesday, November 29, 2011 9:38:49 AM
Rank: Administration
Groups: Administration

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

You need to replace both EO.Web.dll and EO.Pdf.dll. You can find the new EO.Web.dll from the sample directory in the EO.Pdf's installation folder. If you use your old EO.Web.dll with the new EO.Pdf.dll, you will get the Object reference not set to an instance of an object error.

Thanks!
Support@BlackPike.com
Posted: Tuesday, December 6, 2011 5:38:34 PM
Rank: Newbie
Groups: Member

Joined: 11/22/2011
Posts: 7
Hi, just responding here because I have a closely related issue:

I have EO.Pdf (3.0.88.2) and EO.Web (9.0.34.2) but am still getting the infamous "Object reference not set to an instance of an object" error. I've stepped through my code and there's no question it's happening during the call to ASPXToPDF. I am running this on a self-contained development machine with Microsoft Visual Studio 2010. Any thoughts?

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
EO.Web.Internal.c8.a(String A_0) +67
EO.Web.ASPXToPDF.a(Object A_0) +1013
EO.Web.Internal.mb.a(HttpResponse A_0, String A_1) +137
EO.Web.Internal.im.a(HtmlTextWriter A_0, Control A_1) +311
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266
eo_support
Posted: Tuesday, December 6, 2011 6:31:19 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi BlackSpike,

This is the same issue as Hanh. Just refresh both EO.Pdf and EO.Web from our download page and it should take care of it.

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.