Link to home
Start Free TrialLog in
Avatar of Theo
Theo

asked on

How do I shift this block of text

Attached is a pdf of an invoice I am developing on my site. On the left you see the letter head but the details of the adressee shine through it. Setting 'margin-left' for that address has no effect, how can I shift this address to the right.
Attached is also the css for that page. The custromer address is supposed to be steered by the two objects that address the .customer class.
In the default version of this template the letter head is on top only, changing to this vertical letter head put the address in the current position. Hope this is clear.
invoice-2014-2-6.pdf
pdf.css
Avatar of Kimputer
Kimputer

Attaching a prepared sample html page would be nice.
Would need to see the source of the content from which the PDF derives.
Avatar of Theo

ASKER

Gentlemen,
thank you. I attach two php scripts that describe the page. If that isnt sufficient I'llhave to search in the original php-scripts of this Drupal module (named 'Commerce Billy').
commerce-order--commerce-order--.php
commerce-billy-pdf-page.tpl.php
If possible, have an example page already rendered and displayed in front of you in the browser, then "Save as.." html.
Avatar of Theo

ASKER

I know what you mean but such a file is not available, not directly anyway, If I scan through the main php-files (which are attached as well) I find this piece of code, that seems relevant...but I do not know how to use it and get the html.

 * Helper function that returns the generated HTML for the invoice PDFs.
 *
 * @param object[] $orders
 *   Array of order objects.
 */
function commerce_billy_pdf_html($orders) {
  // Backwards compatibilty: also accept a single order object.
  if (is_object($orders)) {
    $orders = array($orders);
  }
  foreach ($orders as $order) {
    $vars['viewed_orders'][] = entity_view('commerce_order', array($order->order_id => $order), 'pdf', NULL, TRUE);
    // Add a credit memo.
    if ($order->status == 'canceled') {
      $vars['viewed_orders'][] = entity_view('commerce_order', array($order->order_id => $order), 'canceled', NULL, TRUE);
    }
  }
  $css_files = variable_get('commerce_billy_pdf_css_files', array(drupal_get_path('module', 'commerce_billy_pdf') . '/css/pdf.css'));
  $vars['inline_css'] = "";
  foreach ($css_files as $file) {
    $vars['inline_css'] .= file_get_contents($file);
  }

  return theme('commerce_billy_pdf_page', $vars);
}

Open in new window

commerce-billy-pdf.module.txt
commerce-billy-pdf.install.txt
commerce-billy-pdf.admin.inc.txt
Does it mean you never see a page (that looks like the pdf output) one step BEFORE you generate the pdf ?
Avatar of Theo

ASKER

Yes indeed. Maybe that 'helper function' is of any use to get to that html, but I do not know how.
@Theo - can you outline the steps you follow to produce the PDF?

Somewhere there might be a way to view the page in the browser - if you can do that and save the page we will be able to help you.
Avatar of Theo

ASKER

The reason this takes so long is that I have asked the developer of the Drupal module that is the issue here to tell me how to get to the html or tell me how to solve the problem described. As so very often in the Drupal world it takes forever for an answre to come if it does at all.
Avatar of Theo

ASKER

The answer apparently doesnt come from Drupal and the reason for that may be that the handling of the html is done by DomPDF. Is there anyone here who is familiar with that? Or should I invoke the services of the moderator here?
ASKER CERTIFIED SOLUTION
Avatar of Kimputer
Kimputer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Theo

ASKER

@kimputer: Yes this works! Feel a bit ashamed that I didnt try this out myself. Wonderful, thank you very much!