Solved

How do I shift this block of text

Posted on 2014-04-23
12
200 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 52

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 52

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
media queries min-width in bootstrap not being read properly 14 47
html form to write data to csv 24 95
Javascript create file issue 4 47
Wrapper for APPs 9 28
This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
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…

914 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

16 Experts available now in Live!

Get 1:1 Help Now