Skip to content

Instantly share code, notes, and snippets.

@0lukasz0
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0lukasz0/7b21ec0636b6a879ca6e to your computer and use it in GitHub Desktop.
Save 0lukasz0/7b21ec0636b6a879ca6e to your computer and use it in GitHub Desktop.
wkhtmltopdf problems
<!DOCTYPE html>
<html lang="pl-PL">
<head>
<meta charset="utf-8" />
<link href="(cut)/styles/PrintDocument.css" rel="stylesheet" type="text/css" />
<link href="(cut)/PrintingViewCss?paperIdentifier=XXX" rel="stylesheet" type="text/css" />
</head>
<body style="margin: 0; padding: 0">
<div class="form-printing">
<p style="text-align: right;">&nbsp;</p>
<p style="text-align: right;">(cut)</p>
<h1>(cut)</h1>
<h3>(cut)</h3>
<p>(cut)</p>
<p><div class="form-group"><label class="col-md-3 control-label" for="f0d6b302-9986-4d0d-a292-3a4a2aea6d68">(cut)</label><div class="col-md-9 has-value" name="(cut)"><p class="form-control-static">(cut)</p></div></div></p>
<p><div class="form-group"><label class="col-md-3 control-label" for="670b7360-c685-46ae-a74f-f2f39b06d477">(cut)</label><div class="col-md-9 has-value" name="(cut)"><p class="form-control-static">(cut)</p></div></div></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="no-break">
<p style="text-align: right;">.........................................................................</p>
<p style="text-align: right;">(cut)</p>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="no-break">
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<link href="(cut)/styles/PrintDocument.css" rel="Stylesheet" type="text/css" />
<link href="(cut)/PrintingViewCss?PaperIdentifier=XXX" rel="Stylesheet" type="text/css" />
</head>
<body style="margin: 0; padding: 0" class="header">
<p style="text-align: center; font-size: small;"><strong>(cut)</strong> <br /><strong>(cut)</strong> <br />(cut)<br />(cut)<br />(cut)<br />(cut) <br />(cut)<br /><br /></p>
<p><strong>(cut)</strong>: (cut)</p>
<p><strong>(cut)</strong>: (cut)</p>
<p><strong>(cut)</strong>: (cut) <strong>(cut)</strong>: (cut)</p>
<p><strong>(cut)</strong>: (cut)</p>
</body>
</html>
body {
font-size: 0.9em;
margin: 0;
/*margin-top: 15px;*/
font-family: Arial, Tahoma, "Helvetica Neue", Helvetica, sans-serif;
}
p {
margin: 0.5em 0;
}
h1 {
text-align: center;
}
h3 {
font-size: 1.5em;
margin-bottom: 0.5em;
}
h4 {
font-size: 1.2em;
margin-bottom: 0.5em;
}
table {
border-collapse: collapse;
width: 100%;
}
table table th, table table td {
border: none;
}
th, td {
padding: 4px;
border: 1px solid black;
}
th {
font-weight: bold;
background-color: #dedede;
}
.not-printable {
display: none;
}
.printable {
display: block !important;
}
.screen-only {
display: none;
}
.print-only {
display: block;
width: 100%;
}
break, .form-group, h1, h2, h3, h4, h5, h6, label, tr {
-moz-page-break-inside: avoid !important;
page-break-inside: avoid !important;
}
//usage: <span class='token-page'>page</span>
//scripts:
<script>
function subst() {
var vars={};
var x=document.location.search.substring(1).split('&');
for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
for(var i in x) {
var y = document.getElementsByClassName('token-' + x[i]);
for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
}
}
try {window.onload=subst;} catch(e) {}
</script>
@model FormPrintingViewModel
@using Namespace.ViewModels
<!DOCTYPE html>
<html lang="@WorkContext.CurrentCulture">
<head>
<meta charset="utf-8" />
<link href="@Url.Content("~/Namespace/styles/PrintDocument.css")" rel="stylesheet" type="text/css" />
<link href="@Model.Styles" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="form-printing">
@Html.Raw(Model.RenderedView)
</div>
</body>
</html>
--page-size A5
--header-html http://localhost:34322/(omitted for brevity)/PrintingViewHeader?paperIdentifier=Custom&entityId=1276
--header-spacing 10
--footer-html http://localhost:34322/(omitted for brevity)/PrintingViewFooter?paperIdentifier=Custom&entityId=1276
--margin-top 65mm
--margin-bottom 15mm
--margin-left 10mm
--margin-right 10mm
--custom-header-propagation
--print-media-type
--custom-header "printer-authoriazation" "(omitted for brevity)"
--cookie "__RequestVerificationToken_L0NsaW5pYw2" "(omitted for brevity)"
--cookie ".ASPXAUTH" "(omitted for brevity)" http://localhost:34322/(omitted for brevity)/PrintingViewBatch?documentIds%5B0%5D=1726&entityId=1276 C:\(omitted for brevity)\05oo31bq.dhe.pdf
--page-width 99mm
--page-height 210mm
--header-html http://localhost:34322/(omitted for brevity)/PrintingViewHeader?paperIdentifier=Custom&entityId=1276
--header-spacing 10
--footer-html http://localhost:34322/(omitted for brevity)/PrintingViewFooter?paperIdentifier=Custom&entityId=1276
--margin-top 65mm
--margin-bottom 15mm
--margin-left 5mm
--margin-right 8mm
--custom-header-propagation
--print-media-type
--custom-header "printer-authoriazation" "(omitted for brevity)"
--cookie "__RequestVerificationToken_L0NsaW5pYw2" "(omitted for brevity)"
--cookie ".ASPXAUTH" "(omitted for brevity)" http://localhost:34322/(omitted for brevity)/PrintingViewBatch?documentIds%5B0%5D=1726&entityId=1276 C:\(omitted for brevity)\bigoblaz.p5l.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment