Welcome Guest Search | Active Topics | Sign In | Register

EO.Pdf.Html Out of memory Options
RJ
Posted: Tuesday, November 4, 2014 1:08:17 AM
Rank: Newbie
Groups: Member

Joined: 11/4/2014
Posts: 1
Hi guys,

I have a following code on which i got the exception -
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

CODE:
EO.Pdf.PdfDocument doc = new EO.Pdf.PdfDocument();

SizeF pageSize = new SizeF(12.29f, 12.29f);
float marginLeft = 0f;
float marginTop = 0f;
float marginRight = 0f;
float marginBottom = 0f;
bool autoFitWidth = true;

HtmlToPdf.Options.PageSize = pageSize;

HtmlToPdf.Options.OutputArea = new RectangleF(
marginLeft, marginTop,
pageSize.Width - marginLeft - marginRight,
pageSize.Height - marginTop - marginBottom);
if(autoFitWidth)
{
HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.ShrinkToFit;

}
else
HtmlToPdf.Options.AutoFitY = HtmlToPdfAutoFitMode.ScaleToFit;


HtmlToPdfOptions opts = new HtmlToPdfOptions();
opts.MaxLoadWaitTime = 360000;
opts.JpegQualityLevel = 96;
opts.MinLoadWaitTime = 12000;

HtmlToPdf.ConvertUrl("http://localhost:59392/MBB/booktopdfHandler.ashx?bookdata=" + ObjItemData.BookString, doc, opts);
doc.Save(ObjItemData.BookPath + ObjItemData.FileName);


I think the pdf creation works fine but at the time of saving that PdfDocument i got that Exception.

Plz can you resolve this asap.

Thanks
eo_support
Posted: Tuesday, November 4, 2014 11:09:55 AM
Rank: Administration
Groups: Administration

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

Please try to isolate the page output and all the depending resource into static files. You can then try to call ConvertUrl with that static file and see if it works. If the problem still occurs, you can send the files to us and we will be happy to take a look. See here for instructions about sending test files/project to us:

http://www.essentialobjects.com/forum/test_project.aspx

Thanks!
Paradigm91
Posted: Wednesday, November 5, 2014 4:25:25 AM
Rank: Newbie
Groups: Member

Joined: 6/6/2014
Posts: 1
Hi team,

As per your suggestion i have created html in static page and also reduces the size of the html to convert but i found some images at last pages were not rendered as result pdf is not proper.

Here is the page html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<link rel='stylesheet' type='text/css' href='http://www.mybabybabbles.com/Css/styles.css' />
<link rel="stylesheet" type="text/css" href="http://www.mybabybabbles.com/Css/book333.css" />
<style type='text/css'>
</style>
</head>
<body>
<div align='left' class='flipbook01'>
<div class='flipbook02'>
<div id='divMagzine' class='magazine teddyblue-theme'>
<div class="hard">
<div class="funsbook01">
<img src="http://mybabybabbles.com/ThemeImages/G0.BookCover.jpg" alt="">
<div class="flipLbook1">
<div class="cont-aj-cover texted page-text-border">
Ishaani</div>
</div>
</div>
</div>
<div class="hard">
<div class="funsbook01 hardinner">
<div class="flipRbook1">
</div>
</div>
</div>
<div>
<div class="funsbook01 hardinner">
<img class="mstn-img" src="http://mybabybabbles.com/BleedThemeImages/Blank-Bleed.jpg"
alt="">
<div class="flipRbook1">
<img class="coverpht" style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/4bc86d2a-f0e2-4881-be17-7208bd56e323.JPG)"
src="https://mb
b-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
</div>
</div>
<div>
<div class="funsbook01">
<img class="mstn-img" src="http://mybabybabbles.com/BleedThemeImages/G3_FOLKTALKES_1.jpg"
alt="">
<div class="flipRbook1 thm1">
<div class="pg3-img-1 image" sort-order="1" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/687a0017-015a-472f-9c1c-76a415090050.jpg)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg3-img-2 image" sort-order="2" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/871be3d1-545c-47ea-b1d4-1eef4ad5bd5b.jpg)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg3-tv-1 texted page-text page-text-border">
<span class="textmiddle">Shruti Jain Arya</span>
</div>
<div class="pg3-tv-2 texted page-text page-text-border">
<span class="textmiddle">9th February, 1982</span>
</div>
<div class="pg3-tv-3 texted page-text page-text-border">
<span class="textmiddle">Books, music, travelling, maggi and more travelling!</span>
</div>
<div class="pg3-tv-4 texted page-text page-text-border">
<span class="textmiddle">Excited that my little doll has arrived ... tired .. nervous..</span>
</div>
<div class="pg3-tv-5 texted page-text page-text-border">
<span class="textmiddle">Sensible, wilful, spoilt</span>
</div>
<div class="pg3-tv-6 texted page-text page-text-border">
<span class="textmiddle">Shrutts</span>
</div>
<div class="pg3-tv-7 texted page-text page-text-border">
<span class="textmiddle">To become a writer</span>
</div>
<div class="pg3-tv-15 texted page-text page-text-border">
<span class="textmiddle">Daddy fell for mommy and chased her all the way to delhi..
mommy gave in and we got married soon after! </span>
</div>
</div>
</div>
</div>
<div>
<div class="funsbook01">
<img class="mstn-img" src="http://mybabybabbles.com/BleedThemeImages/G3_FOLKTALKES_2.jpg"
alt="">
<div class="flipLbook1 thm1">
<div class="pg3-tv-8 texted page-text page-text-border">
<span class="textmiddle">Nakul Arya</span>
</div>
<div class="pg3-tv-9 texted page-text page-text-border">
<span class="textmiddle">2nd November, 1980</span>
</div>
<div class="pg3-tv-10 texted page-text page-text-border">
<span class="textmiddle">Technology, gadgets, phones, Apple, pizza</span>
</div>
<div class="pg3-tv-11 texted page-text page-text-border">
<span class="textmiddle">Elated that its a girl .... now thinking what am i going to
do with a lil girl !!</span>
</div>
<div class="pg3-tv-12 texted page-text page-text-border">
<span class="textmiddle">Mild, stubborn, naughty -on-the-sly</span>
</div>
<div class="pg3-tv-13 texted page-text page-text-border">
<span class="textmiddle">Monu</span>
</div>
<div class="pg3-tv-14 texted page-text page-text-border">
<span class="textmiddle">To be a magician</span>
</div>
<div class="pg3-img-3 image" sort-order="3" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/9cc3b678-7705-4a96-a26a-42838846f2bc.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg3-img-4 image" sort-order="4" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/cfe12545-b1a5-4227-be3e-9cb5d9ca79d4.jpg)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg3-img-5 image" sort-order="5" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/d1d91853-5279-443e-88e8-11873230fb03.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg3-img-6 image" sort-order="6" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/69d82ce0-aa19-4ac1-9aaa-cd37a86c5425.jpg)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
</div>
</div>
</div>
<div>
<div class="funsbook01">
<img class="mstn-img" src="http://mybabybabbles.com/BleedThemeImages/G4_HELLOWORLD_1.jpg"
alt="">
<div class="flipRbook1 thm1">
<div class="pg4-img-1 image" sort-order="1" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/ef65a30b-9d13-4e44-bcc0-d795a6acdf2b.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div align="center" class="pg4-tv-1 texted page-text page-text-border">
<span class="textmiddle">Ishaani Arya</span>
</div>
<div align="center" class="pg4-tv-2 texted page-text page-text-border">
<span class="textmiddle">7th October, 2013</span>
</div>
<div align="center" class="pg4-tv-3 texted page-text page-text-border">
<span class="textmiddle">8.45 AM</span>
</div>
<div align="center" class="pg4-tv-4 texted page-text page-text-border">
<span class="textmiddle">Breach Candy Hospital</span>
</div>
</div>
</div>
</div>
<div>
<div class="funsbook01">
<img class="mstn-img" src="http://mybabybabbles.com/BleedThemeImages/G4_HELLOWORLD_2.jpg"
alt="">
<div class="flipLbook1 thm1">
<div class="pg4-tv-5 texted page-text page-text-border">
<span class="textmiddle">2.89 KGS</span>
</div>
<div class="pg4-tv-6 texted page-text page-text-border">
<span class="textmiddle">49 cm</span>
</div>
<div class="pg4-tv-7 texted page-text page-text-border">
<span class="textmiddle">Dark, dark brown</span>
</div>
<div class="pg4-tv-8 texted page-text page-text-border">
<span class="textmiddle">Hazel</span>
</div>
<div class="pg4-tv-9 texted page-text page-text-border">
<span class="textmiddle">Everyone from the Jain family said you looked exactly like
us</span>
</div>
<div class="pg4-tv-10 texted page-text page-text-border">
<span class="textmiddle">Dadi and dada still maintain you have gone on your dad</span>
</div>
</div>
</div>
</div>
<div>
<div class="funsbook01">
<img class="mstn-img" src="http://mybabybabbles.com/BleedThemeImages/G4_HELLOWORLD_3.jpg"
alt="">
<div class="flipRbook1 thm1">
<div class="pg5-img-1 image" sort-order="2" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/50fd2706-aaef-4d1a-8607-f9fd9e0ae54a.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg5-img-2 image" sort-order="3" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/cfb2cc43-9d17-4216-a01c-7f936a529253.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg5-img-3 image" sort-order="4" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/19caad48-1966-4aad-a20b-a3dd3bdd3fff.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg5-img-4 image" sort-order="5" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/a2a2731a-ec52-4864-aff5-9f52410b09d5.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg5-img-5 image" sort-order="6" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/620fd65a-e655-4f71-b013-a85517940e39.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg5-img-6 image" sort-order="7" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/3be22b6b-e24a-4661-be37-9add945c4e8e.jpg)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg5-tv-1 texted page-text page-text-border">
<span class="textmiddle">All our family members from both sides as well as our close
friends came to the hospital to see you.</span>
</div>
<div class="pg5-tv-2 texted page-text page-text-border">
<span class="textmiddle">Clothes, baby photo frames, gold coins, envelopes..</span>
</div>
</div>
</div>
</div>
<div>
<div class="funsbook01">
<img class="mstn-img" src="http://mybabybabbles.com/BleedThemeImages/G4_HELLOWORLD_4.jpg"
alt="">
<div class="flipLbook1 thm1">
<div class="pg5-tv-3 texted page-text page-text-border">
<span class="textmiddle">You were born on the 3rd day of Navratras, the day dedicated
to goddesses. Ishaani means the ruling goddess, Parvati, Durga.</span>
</div>
<div class="pg5-tv-4 texted page-text page-text-border">
<span class="textmiddle">Ishu, Hazel</span>
</div>
<div class="pg5-tv-5 texted page-text page-text-border">
<span class="textmiddle">Libra</span>
</div>
<div class="pg5-tv-6 texted page-text page-text-border">
<span class="textmiddle">Little doll, first girl in the family of boys, quite a fire
cracker, had the loudest cry and a piercing gaze!</span>
</div>
<div class="pg5-img-7 image" sort-order="8" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/76795782-0fc3-4154-9860-5ee2a98a1e05.jpg)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg5-img-8 image" sort-order="9" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/443bc870-729f-448d-b1d0-9686296d6c79.jpg)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
</div>
</div>
</div>
<div>
<div class="funsbook01">
<img class="mstn-img" src="http://mybabybabbles.com/BleedThemeImages/G5_HOMESWEETHOME_1.jpg"
alt="">
<div class="flipRbook1 thm1">
<div class="pg6-img-1 image" sort-order="1" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/c0d715fd-0168-4c62-9bf8-604cc8132d94.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg6-img-2 image" sort-order="2" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/8f6558bb-792c-4234-9f34-0b352e15f16c.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg6-tv-1 texted page-text page-text-border">
<span class="textmiddle">Satlaj Terrace, Walkeshwar, Mumbai</span>
</div>
<div class="pg6-tv-2 texted page-text page-text-border">
<span class="textmiddle">You adjusted beautifully into your new environment. Luckily
for us, you slept all the way home and continued to sleep once you reached home!</span>
</div>
</div>
</div>
</div>
<div>
<div class="funsbook01">
<img class="mstn-img" src="http://mybabybabbles.com/BleedThemeImages/G5_HOMESWEETHOME_2.jpg"
alt="">
<div class="flipLbook1 thm1">
<div class="pg6-tv-3 texted page-text page-text-border">
<span class="textmiddle">Everyone from the family was there to welcome you home. There
was Dada, Dadi, Masis, Chachu and Nani.</span>
</div>
<div class="pg6-img-3 image" sort-order="3" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/b14b4b66-19f9-402b-be62-3983b78b1793.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg6-img-4 image" sort-order="4" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/6193ae03-ab6d-4a72-8c82-412e3fc5e21b.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg6-img-5 image" sort-order="5" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/ef0d71a5-7881-412c-9ba1-a9e6aab74758.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
<div class="pg6-img-6 image" sort-order="6" droppable="true">
<img style="background-image: url(https://mbb-live-images.s3.amazonaws.com/MileStoneImages/0a21e3f0-530a-4f50-842b-d4b06d930946.JPG)"
src="https://mbb-live-images.s3.amazonaws.com/MileStoneImages/clear.gif" alt="" />
</div>
</div>
</div>
</div>
<div>
<div class="funsbook01">
<div class="funsbook01 hardinner">
</div>
</div>
</div>
<div class="hard">
<div class="funsbook01 hardinner">
<div class="flipRbook1">
</div>
</div>
</div>
<div class="hard">
<div class="funsbook01">
<img src="http://mybabybabbles.com/BleedThemeImages/credits-with bleed-01.jpg" alt="">
<div class="flipLbook1">
</div>
</div>
</div>
<div class="hard">
<div class="funsbook01 hardinner">
<div class="flipRbook1">
</div>
</div>
</div>
<div class="hard">
<div class="funsbook01">
<img src="http://mybabybabbles.com/ThemeImages/G0_BackCover.jpg" alt="">
<div class="flipLbook1">
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Could you resolve the problem or convert the pdf.
eo_support
Posted: Sunday, November 9, 2014 8:35:23 PM
Rank: Administration
Groups: Administration

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

Please check your EO.Pdf version. We tested with the latest EO.Pdf.dll (6.0.21) and it seems to work fine. The last image we see is the "my baby babbles" balloon image both in a browser and in the result PDF file. The image did however got split into two pages. You can avoid that by adding the following CSS rules:

Code: CSS
img { page-break-inside: avoid; }


You can find more information about page breaking here:

http://www.essentialobjects.com/doc/4/htmltopdf/paging.aspx

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.