Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6143567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:32:24+00:00 2026-05-23T18:32:24+00:00

I have the following bits of code: public static void WriteHTML(string cFile, List<Movie> mList)

  • 0

I have the following bits of code:

 public static void WriteHTML(string cFile, List<Movie> mList)
        {
            int lineID = 0;
            string strMovie, strGenre, tmpGenre = null;

            // initiates streamwriter for catalog output file
            FileStream fs = new FileStream(cFile, FileMode.Create);
            StreamWriter catalog = new StreamWriter(fs);

            string strHeader = "<style type=\"text/css\">\r\n" + "<!--\r\n" + "tr#odd {\r\n" + "    background-color:#e2e2e2;\r\n" + "  vertical-align:top;\r\n" + "}\r\n" + "\r\n" + "tr#even {\r\n" + "   vertical-align:top;\r\n" + "}\r\n" + "div#title {\r\n" + "  font-size:16px;\r\n" + "    font-weight:bold;\r\n" + "}\r\n" + "\r\n" + "div#mpaa {\r\n" + "    font-size:10px;\r\n" + "}\r\n" + "\r\n" + "div#genre {\r\n" + " font-size:12px;\r\n" + "    font-style:italic;\r\n" + "}\r\n" + "\r\n" + "div#plot {\r\n" + "   height: 63px;\r\n" + "  font-size:12px;\r\n" + "    overflow:hidden;\r\n" + "}\r\n" + "-->\r\n" + "</style>\r\n" + "\r\n" + "<html>\r\n" + "    <body>\r\n" + "     <table>\r\n";
            catalog.WriteLine(strHeader);

            foreach (Movie m in mList)
            {
                strMovie = lineID == 0 ? "          <tr id=\"odd\" style=\"page-break-inside:avoid\">" : "          <tr id=\"even\" style=\"page-break-inside:avoid\">";
                catalog.WriteLine(strMovie);

                foreach (string genre in m.Genres)
                    tmpGenre += ", " + genre;

                try
                { strGenre = tmpGenre.Substring(2); }
                catch (Exception)
                { strGenre = null; }

                strMovie = "                <td>\r\n" + "                   <img src=\".\\images\\" + m.ImageFile + "\" width=\"75\" height=\"110\">\r\n" + "               </td>\r\n" + "              <td>\r\n" + "                   <div id=\"title\">" + m.Title + "</div>\r\n" + "                    <div id=\"mpaa\">" + m.Certification + " " + m.MPAA + "</div>\r\n" + "                  <div id=\"genre\">" + strGenre + "</div>\r\n" + "                   <div id=\"plot\">" + m.Plot + "</div>\r\n" + "              </td>\r\n" + "          </tr>\r\n";
                catalog.WriteLine(strMovie);
                lineID = lineID == 0 ? 1 : 0;
            }

            catalog.WriteLine("     </table>\r\n" + "   </body>\r\n" + "</html>");
            catalog.Close();
        }




        public static void WritePDF(string cFile, string pdfFile)
        {
            // Sets up PDF to write to
            EO.Pdf.HtmlToPdf.Options.PageSize = new SizeF(8.5f, 11f);
            EO.Pdf.HtmlToPdf.Options.OutputArea = new RectangleF(0.5f, .25f, 7.5f, 10.25f);

            HtmlToPdf.ConvertUrl(cFile, pdfFile);
        }

My HTML file writes fine, but when it tried to convert the HTML file to PDF I get an exception that it times out.

I did a test previously, and had it convert the code (not the file) within the WriteHTML function and it worked great. I have confirmed that the cFile exists and is a valid file (created previously in WriteHTML). The path to pdfFile is valid, and the documentation does not state the file needs to already exist (.ConvertHTML did not need an existing file).

Only thing I can think of is that the catalog.html file isn’t released and ready to read yet. I made sure I closed it in the WriteHTML function. How can I test that the file is ready to be read?

Tried setting .MaxLoadWaitTime = 120000 with no luck.

Any clues would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:32:25+00:00Added an answer on May 23, 2026 at 6:32 pm

    After a battery of further testing, and scouring the EO support forums, it appears to be a limitation of the free version of EO. It seems to have difficulty with HTML files over 3MB.

    It’s a shame since the EO product is very good, but not unfortunately not worth $250 IMO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following bits of code in my accountRepository public string[] GetRolesForUser(string email)
I have the following code: #include <stdio.h> int main(void) { int x __attribute__ ((aligned
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have following classes. class A { public: void fun(); } class B: public
I have the following code, for an embedded platform where an int is 16
I have the following bits of code: <h:panelGroup rendered=#{userTypeController.permissionItemsUserType.contains(item)}> <h:selectBooleanCheckbox valueChangeListener=#{userTypeController.permissionChanged(this)} value=#{true}/> <h:outputText value=#{item.getAction()}
I have the following bits of code which, in my mind, seem like the
I have the following code #include <iostream> #include <vector> using namespace std; int distance(vector<int>&
I have the following code that does a circular shift of the bits in
I have the following code in C: int l; short s; l = 0xdeadbeef;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.