Wanze

Module
Pages2Pdf

233 posts in this topic

On 21.2.2017 at 5:49 PM, zyON said:

Is there an easy way to remove the space occupied by the header? It's probably me or my setup but I can't seem to remove the space.

Maybe you can set the headerMargin setting to zero in the WirePDF module configuration? Do you print the header?

Share this post


Link to post
Share on other sites

Hi @Wanze, i tried it all:

 

<img src="<?=$mandant->teaserbild->first()->height('100')->url;?>" width="<?=$mandant->teaserbild->first()->height('100')->width;?>" height="100" alt="logo" />

// AND

<img src="<?=$mandant->teaserbild->first()->height('100')->httpUrl;?>" width="<?=$mandant->teaserbild->first()->height('100')->width;?>" height="100" alt="logo" />

// AND ALSO

$imagedata = file_get_contents($mandant->teaserbild->first()->height('100')->filename);
$base64Img = "data:image/png;base64," . base64_encode($imagedata);
<img src="<?=$base64Img;?>" width="<?=$mandant->teaserbild->first()->height('100')->width;?>" height="100" alt="logo" />

 

but nothing works. How do I enable debug mode (showImageErrors) for the pdf module?

 

Thanks,

thomas

 

Share this post


Link to post
Share on other sites

Strange update:

 

$pdf->save();

shows the images, but

$pdf->download();

doesn't. Not sure what's going on here but I can work around that.

Thanks,

thomas

Share this post


Link to post
Share on other sites

Greeting,

I need help to use a font 'dejavusans'? I have problems with the display Croatian letters š, đ, č, ć, ž.

I use

$pdf = $modules->get('WirePDF');

but I can not set the font 'dejavusans'

<?php

$pdf = $modules->get('WirePDF');

$mpdf = $pdf->mpdf;

$pdfPath = $config->paths->files . $page->id . "/" . $page->title.'.pdf';
$stylesheet = file_get_contents($config->paths->templates.'/pages2pdf/styles.css');

$wireSendOptions = array('exit' => false, 'forceDownload' => false, 'downloadFilename' => '');

$mpdf->WriteHTML($stylesheet,1);

$html = "";
$html .= "<html lang='hr'><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head><body>";
$html .= '<table border=0>';
$html .= 'text example š đ č ć ž';
$html .= "</body></html>";
$mpdf->WriteHTML($html);

$mpdf->Output($pdfPath, 'F');
wireSendFile($pdfPath, $wireSendOptions );
?>

 

Share this post


Link to post
Share on other sites

In administration, inside the WirePdf configuration, when I set Mode: "s"  then I get a an exception:

mPDF Error - cannot find TTF TrueType font file - /.../site/templates/fonts/DejaVuSans.ttf": invalid checksum 26f399eb8 table: FFTM (expected 6f399eb8)

Can i help me why there is a exception?

Share this post


Link to post
Share on other sites
On 08/03/2017 at 1:52 PM, Wanze said:

Maybe you can set the headerMargin setting to zero in the WirePDF module configuration? Do you print the header?

Wanze, yes thanks. I was missing the configuration options on the WirePDF module (was checking only the Pages2PDF module configuration).

Share this post


Link to post
Share on other sites

I'm trying to use this module to create a PDF of a page on my website. I've tried following along with this thread and the tutorials, etc on Github but I'm still having trouble getting it to work correctly. The page in question is vector.houseofdeadleg.co.uk. If you click on the button the pdf downloads but only includes a header and footer, and any text on the page. I can't get the images to be included.

Share this post


Link to post
Share on other sites

I have this installed on PW3 and my supposed pages2pdf link simply loads the page with the get variable specified ={page.id}, not as a PDF. What could be the matter?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By benbyf
      HELLO!
      I've been working on a user messaging module which I am nearly ready to release as version 1.
      Currently I have the below functionality and I'm looking for feedback to what other things may be useful for people looking to add user to user messaging on their sites.
      compose message to one or more users known to PW js to enable tag based UI display of user names input on compose message form display all message threads with reply forms reply to message thread displaying each user name by each message in the thread display "unread" when a thread has new content that hasnt been seen by current user delete or unpublish message thread (configurable) display total message thread count display total unread threads (threads that have new replies that the current user has not seen) delete all message threads and associated data (not meant for the users to have access to) road map
      send email to user on new message to a thread they are included in
    • By louisstephens
      So I was working on a module and trying to include a library (so I could use it across the site) using $modules->get('myModule'); . However, When I go to include the library folder (modeled after the LibFlourish module created some time ago). I keep getting: 
      site/modules/MyModule/libraryName/ProcessWire\filetoinclude.php This comes with an error notifying that "failed to open stream: No such file or directory in ...".. Is ProcessWire supposed to be in the include url, or is there a way around this? Sorry, I am quite new to working with my own modules.
       
      I just noticed the sub forum regarding Development, if someone could move this to the correct area I would appreciate it.
    • By louisstephens
      I wasn't quite sure where to post this, as this is a question regarding the module (sorry if it is in the wrong place). I was wondering if anyone has used the Email to Page module and figured out a way to "move" incoming css to another field, or how to render the css so the message just renders utilizing the css. 
      Right now all of the message contents get dropped into a textarea field and display in a template as a jumbled mess. Perhaps I am missing a formatting option in the text area field to render the css and html.
    • By blynx
      Hej,
      just finished the first working version of my photoswipe bundle. https://github.com/blynx/MarkupProcesswirePhotoswipe
      Haven't published it to the module directory, yet. Wanted to wait for some feedback.
      You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method:
      <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so:
      <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe
      It is possible to customize pretty much anything by providing your own templates and scripts.
      What do you think? Any ideas, bugs, critique, requests?
      cheers
      Steffen
    • By kixe
      FieldtypeColor is on github

      Fieldtype stores a 32bit integer value reflecting a RGBA value.
      Input
      4 types of Inputfields provided
      Html5 Inputfield of type='color' (if supported by browser)    Inputfield type='text' expecting a 24bit hexcode string (RGB). Input format: '#4496dd'.
      The background color of the input field shows selected color Inputfield of type='text' expecting 32bit hexcode strings (RGB + alpha channel) Input format: '#fa4496dd' Inputfield with Spectrum Color Picker
      (Options modifiable) Inputfield type='text' with custom JavaScript and/or CSS (since version 1.0.3) Output
      Define output format under 'Details' tab in field settings. Select from the following 8 options
      string 6-digit hex color. Example: '#4496dd' string 8-digit hex color (limited browser support).  Example: '#fa4496dd' string CSS color value RGB. Example: 'rgb(68, 100, 221)' string CSS color value RGB. Example: 'rgba(68, 100, 221, 0.98)' string CSS color value RGB. Example: 'hsl(227, 69.2%, 56.7%)' string CSS color value RGB. Example: 'hsla(227, 69.2%, 56.7%, 0.98)' string 32bit raw hex value. Example: 'fa4496dd' int 32bit. Example: '4198799069' (unformatted storage value) The Fieldtype includes
      Spectrum Color Picker by Brian Grinstead

      SCREENSHOTS
      Input type=text with changing background and font color (for better contrast)

      Input type=color (in Firefox)


      Javascript based input (Spectrum Color Picker)


      Settings Output

       
      Settings Input