Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing wkhtmltopdf inside asp.net mvc takes a long time to start
    primarykey
    data
    text
    <p>I'm using wkhtmltopdf to download a page and create a pdf, as explaind in <a href="https://stackoverflow.com/questions/1331926/calling-wkhtmltopdf-to-generate-pdf-from-html/1698839#1698839">here</a>. It all works as expected, but when it reaches the following line:</p> <pre><code>int read = proc.StandardOutput.BaseStream.Read(buffer, 0, buffer.Length); </code></pre> <p>It takes a very long time to continue. I've also tried the following: </p> <pre><code>proc.Start(); string output = proc.StandardOutput.ReadToEnd(); string error = proc.StandardError.ReadToEnd(); proc.WaitForExit(); </code></pre> <p>But the same thing happen on line 2 (<code>proc.StandardOutput.ReadToEnd()</code>).</p> <p>How can i debug this?</p> <p>Note: As i'm debugging the whole project, i see that the page that is being called by the wkhtmltopdf process only gets called after the delay. So the delay happens between the OS call and the page download itself.</p> <hr> <p>Edit</p> <p>So i changed the arguments portion to simply <code>http://google.com -</code> and it executed quite fast.</p> <p>So the problem is somewhere in my full argument: <code>--stop-slow-scripts --redirect-delay 1500 --cookie MOODLEID_ %25E2%25C8%2513E%25BD --cookie ASP.NET_SessionId mg3mfaisk45zn5y1aql0glbb --cookie .ASPXAUTH FEA3D10032E211EDB330E967D8F19A324A912AD792219CA281451AA809F1B580B25466DAF81DE30DF07252FF13F0888C88ED4DB5871579F1DA3EBAA447CBF860131F6FF00A763C9207CE13BCB143301E49A2B00EEBBF1F4AE14F109DF1BE8D3B39C43478B99E4C686C3849D1D51DDBFA3D2E871691BAB8346FE5195D867F88F662F72E40 http://localhost:8404/Relatorio/GeralEstaticoPDF?id=15&amp;pesq_cod=0&amp;IncluirParciais=True&amp;NomesImagens[0]=3fd5b6a2-76a4-470b-af99-93500cc90431.png&amp;NomesImagens[1]=c1c86234-c338-4285-9d25-5069be36a213.png&amp;NomesImagens[2]=4562f9a3-72aa-452c-9736-6d0ba65f59ce.png&amp;NomesImagens[3]=dbc54344-6248-4ee3-9e43-9cb3ef89cc67.png&amp;NomesImagens[4]=8c954917-d572-4d4a-b6fd-2b9cd09e8f8e.png -</code></p> <p>I need the cookies to preserve the session.</p> <p>If i run this directly on command line (but putting in a file name instead of <code>-</code>) it runs fast as well.</p> <hr> <p>Edit 2</p> <p>So the problem is definitely the cookies, if i remove them it execute fast, BUT it only give me the login screen on the pdf, since it isnt preserving the session.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload