Solved

How do I shift this block of text

Posted on 2014-04-23
12
203 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
  • 6
  • 4
  • 2
12 Comments
 
LVL 35

Expert Comment

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

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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 35

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 35

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 55

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 35

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

830 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