Rank: Advanced Member Groups: Member
Joined: 2/27/2010 Posts: 69
|
I'm reviewing your EO.PDF product for purchase, experimenting with the htmlToPDF.ConvertHTML feature. It works find except I cannot seem to get the graphics to print. I just get bounding boxes. Is there some trick to this? They show on the web page, and the AspxToPdf feature prints them correctly. Also, this prompt to save the PDF document. How can I just get it to open in a PDF window? Thanks. Sample code below. Using: EO.Pdf.HtmlToPdf.ConvertHtml(strHTMLtoPrint, Response.OutputStream)
Code: HTML/ASPX
<img width="178" height="207" style="MARGIN: 4px; WIDTH: 178px; FLOAT: right; HEIGHT: 207px" alt="" src="/Images/Features/ID_41_maximilian.jpg" />Emperor Ferdinand Maximilian sat before his ornate desk in the corner of a small chamber. His long fingers scratched at his cheek through a well-trimmed beard. The evening breeze ruffled curtains drawn to the side to frame an arched window that overlooked the palace. A Mexican soldier stood at attention, waiting patiently just inside the balcony. Maximillian stared past the soldier, toward the distance watch fires that blazed at the perimeter of Mexico City. <br /><br />The Emperor turned back and scribbled his name on the paper that lay before him. After shaking powder across the page to dry the ink, he arose and crossed to the young officer who folded the parchment and stuffed it inside his coat. The man gave a formal bow, then <img width="400" height="122" style="WIDTH: 271px; FLOAT: left; HEIGHT: 93px" alt="" src="Images/Features/ID_41_packtrain.gif" />disappear
ed behind some heavy drapes that covered a narrow passage hewn from the stucco wall. <br /><br /><img width="226" style="MARGIN: 8px; FLOAT: right" alt="" src="Images/Features/ID_41_Map.jpg" />The soldier descended a steep stairwell making his way into the bowels of the palace. He exited at the base of the rocky hill where a small pack train waited in the shadows. Quietly, and under the cover of darkness, it began its journey. <br /><br />The heavily-laden caravan carried the remnants of Maximillian’s royal treasure - gold, jewels, artwork, and silver coins - into Indian Territory. Its destination was a rail station in Kansas where it could be sent to the East coast, then shipped to Austria, homeland of the Emperor. But as the pack train reached Bugaboo Canyon near present-day Stringtown, Oklahoma, the Mexicans were infected with smallpox. Most died and the survivors, unable to continue their mission, buried the dead then hid the treasure, and returned to Mexico. <br /><br />Just a few months later Maximilian
was imprisoned in a dank crypt and eventually executed. His young bride, Carlota, having been unsuccessful in a mission to gain Napoleon III's help, succumbed to the strain and went mad. <br /><br />No one knows if the treasure was ever recovered."
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,240
|
Hi, That will occur when you did not set HtmlToPdf.Options.BaseUrl correctly. When you call ConvertHtml and your HTML includes relative path such as "/Images/abc.gif", the converter will need a "BaseUrl" to figure out the full absolute Url of your image. Otherwise it does not know where to get your images. BaseUrl is not needed when you call ConvertUrl because the converter can automatically figure out BaseUrl based on your page Url. ASPXToPDF also automatically set BaseUrl based on your page url. So you only need set BaseUrl when you call ConvertHtml directly. The sample code at here should just open the PDF directly in the browser: http://doc.essentialobjects.com/library/4/web/pdf_on_demand.aspxIn fact that's the default behavior, you have to have additional code to have the browser to prompt "Save As" dialog. It is also possible that the Adobe Reader Plug-in is not correctly installed on your browser. In that case your browser would not know how to load it directly in the browser window, so it would prompt "Save As" regardless. Thus you may want to check on a different machine or with a different browser. Hope this helps. Please let us know if you still have any questions. Thanks!
|