Solved

How do I shift this block of text

Posted on 2014-04-23
12
199 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 51

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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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 51

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now