Solved

How do I shift this block of text

Posted on 2014-04-23
12
207 Views
Last Modified: 2014-05-21
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
0
Comment
Question by:TheoRichel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 2
12 Comments
 
LVL 36

Expert Comment

by:Kimputer
ID: 40017230
Attaching a prepared sample html page would be nice.
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 40017238
Would need to see the source of the content from which the PDF derives.
0
 

Author Comment

by:TheoRichel
ID: 40017285
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
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 36

Expert Comment

by:Kimputer
ID: 40017303
If possible, have an example page already rendered and displayed in front of you in the browser, then "Save as.." html.
0
 

Author Comment

by:TheoRichel
ID: 40017368
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
0
 
LVL 36

Expert Comment

by:Kimputer
ID: 40017516
Does it mean you never see a page (that looks like the pdf output) one step BEFORE you generate the pdf ?
0
 

Author Comment

by:TheoRichel
ID: 40017530
Yes indeed. Maybe that 'helper function' is of any use to get to that html, but I do not know how.
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 40017817
@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.
0
 

Author Comment

by:TheoRichel
ID: 40051150
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.
0
 

Author Comment

by:TheoRichel
ID: 40080199
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?
0
 
LVL 36

Accepted Solution

by:
Kimputer earned 500 total points
ID: 40080335
I guess you are in a position to change something quickly, test it, and return original code? Because we are missing information, it might be the only way:

Try this in your pdf.css file

.customer {
  position: absolute;
  top: 60px;
  margin-left: 550px;
  }

Open in new window

0
 

Author Comment

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

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question