On page break double increments of space

87 views
Skip to first unread message

Tamaghna Banerjee

unread,
Feb 17, 2016, 3:35:16 AM2/17/16
to dompdf-dev
 I have a pdf with multiple pages,after first page,on every next page,space from header to content become increased and actually it's doubled,my attached pdf is the best example to recognize my problem.

Though I have fixed the issue by myself,but not solved with best practices keeping in mind.Below is my HTML and css snippet that I can share maximum,cause I am using Drupal with Dompdf.

<body>
  <div class="watermark"></div>
  <div class="main-layer"></div>

  <div class="print-site_name"><?php print theme('print_published'); ?></div>
  <p />
  <div class="print-breadcrumb"><?php print theme('print_breadcrumb', array('node' => $node)); ?></div>

  <?php if (!isset($node->type)): ?>
  <h2 class="print-title"><?php print $print_title; ?></h2>
<?php endif; ?>

<div class="print-content"><?php print $content; ?></div>

<?php if ($sourceurl_enabled): ?>
  <div class="print-source_url">
    <?php print theme('print_sourceurl', array('url' => $source_url, 'node' => $node, 'cid' => $cid)); ?>
  </div>
<?php endif; ?>
<div class="print-links"><?php print theme('print_url_list'); ?></div>
<?php print $footer_scripts; ?>
</body>

/* --- Layer Styling --- */
.watermark {
  background-image: url("../images/watermark.gif");
  position: fixed;
  top: 19px;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  z-index: -1;
  opacity: 0.7;
}
.main-layer {
  background-image: url("../images/main-layer.png");
  position: fixed;
  bottom: 0;
  left: 0px;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  z-index: -2;
}

/* --- Overall Content --- */
.print-content{
  z-index: 2;
  opacity: 0.8;
}

/* --- Proposal Body --- */

.view-proposal .view-header{
  margin-top: 4em;
  padding-bottom: 0.5em;
  opacity: 0.8;
}

.view-proposal .view-content .views-field-field-things-to-do-1{
  page-break-after: always;
}

Proposal body section is not giving,I can't, cause Drupal internally generate that div html.

PlanMyHoliday.-.pdf

BrianS

unread,
Feb 18, 2016, 1:57:44 PM2/18/16
to dompdf-dev
The dompdf-dev forum is oriented to questions about the development of the library. For support issues you should use the dompdf forum.

It will be a bit hard to debug the issue without a full HTML sample. If this is an existing page on the drupal site you could just provide a link to the page. If the page is generated specifically for dompdf there must be a way to retrieve the HTML. For instance, you could modify how dompdf is used to call $dompdf->output_html() instead of $dompdf->stream().
Reply all
Reply to author
Forward
0 new messages