Jump to content

charger

Members
  • Posts

    111
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by charger

  1. Thanks for the detailed write-up! Would you mind sharing how exactly you sync the PW routes with Vue router?
  2. I can do that, but you don’t have to set up a new environment. You just grab the PW files and put them in a newly created folder in your webserver’s root.
  3. I was able to solve the problem meanwhile. It was related to my template file structure. I’m using the delayed output strategy together with some nested wireRenderFile() calls which lead to the problem.
  4. The following line in RockPdf.module.php returns a wrong URL if the PW installation lives in a subdirectory (subdirectory is applied twice): 'httpUrl' => rtrim($this->pages->get(1)->httpUrl, '/') . $url,
  5. Thanks for the hint, wasn’t aware of that. But if the default age for a temp folder is 120 seconds, then that should be plenty of time already. The PDF generation maybe takes around 3 seconds.
  6. This will not work for me as I generate the PDF if there’s a "pdf" GET parameter found (this is e.g. how https://github.com/wanze/Pages2Pdf handles it as well). That’s why I was pursuing another way meanwhile: the wireSendFile() function (https://github.com/processwire/processwire/blob/master/wire/core/Functions.php#L257, https://github.com/wanze/Pages2Pdf/blob/master/Pages2Pdf.module#L312). Here’s the relevant code from my template file: $inputPdf = $input->get('pdf'); $inputPdfSan = $sanitizer->int($inputPdf); if ($inputPdfSan == 1) { $pdf = $modules->get('RockPdf'); $pdf->settings([ 'tempDir' => $this->config->paths->root . 'site/assets/cache/WireTempDir/.RockPdf/test/', ], 'mode' => 's', 'mirrorMargins' => 1, ]); $mpdf = $pdf->mpdf; $mpdf->WriteHTML('Hello World ' . date('H:i:s')); $filename = $page->name . '-pdf-' . $page->id . '.pdf'; $response = $pdf->save($filename); wireSendFile($response->path, array('forceDownload' => true)); } However, the problem remains: the PDFs do get saved correctly, but when trying to download them (either via wireSendFile() or RockPDF’s download()), they are blank or corrupted.
  7. Hmm, that didn’t help on my side. I still see the "Unable to remove" errors in the wire-temp-dir logfile, now they’re just referring to the newly set directory. And yes, these are more complex PDFs, but not overly complex (~3MB).
  8. What kind of mime-type errors? And how could that be related to PW only but not the webserver or PHP in general? I also just checked it on the webserver (was on localhost before): same problem there. It’s weird that one option would work while the other two wouldn’t. I can’t make sense of it atm.
  9. @bernhard download() and show() both work outside of PW.
  10. Latest Chrome/Safari/Firefox on macOS 10.14 show all the same problem. The weird thing is it creates the correct amount of pages in the PDF, they’re just blank. Calling `$mpdf->Output($filename, \Mpdf\Output\Destination::DOWNLOAD);` directly results in the same error.
  11. Did anyone else encounter problems with `show()` and `download()`? If I use them, all I get is blank pages resulting in an invalid PDF. The `save()` function works as expected though. I’m running PW 3.0.98 with PHP 7.1.12 and RockPdf 1.0.1
  12. You’re right. Bad example. But it also doesn’t work with width and height values like this: @page { size: 100mm 150mm; }
  13. Did anyone successfully use @page in the stylesheet to e.g. set page size or margins? I don’t see anything happen if I add the following code block to templates/pages2pdf/styles.css: @page { size: A5; margin: 10mm; } I’m using the dev branch of Pages2Pdf (mPDF v6.1).
  14. Found the solution myself: https://github.com/wanze/Pages2Pdf/pull/13
  15. Did anyone get odd/even header/footers and margins working? I’m using the dev branch of Pages2Pdf and can’t seem to find a way to do it.
  16. Is there a particular reason why $page->localUrl() returns "" even if the backend says it’s not empty (as the value is inherited from the default language)?
  17. Sorry, my bad! I was looking for the wrong module. What I wanted was to get rid of multilang page names, which of course is the Languages Support - Page Names module. This one I could uninstall without problems.
  18. How is it possible to uninstall the FieldtypePageTitleLanguage module? Uninstall is disabled in the module config: I’m aware it is used on the name field. But how can I remove it there?
  19. @ryan It might be useful to update the module documentation regarding your latest release (2.0.8) from... <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?sensor=false'></script> to something like... <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=<?=$modules->FieldtypeMapMarker->googleApiKey?>'></script> ...in order for the frontend to also use the API key when rendering a map.
  20. You’re of course right. The problem is that the pages that reside in these InputfieldPageTable fields will be moved out of their previous (nested) structure and are applied (flat) to the parent one selects during import.
  21. Seems like Migrator has problems with templates that include InputfieldPageTable fields. When importing pages that include this fieldtype, Migrator also creates the pages that are stored inside this fieldtype.
  22. $pages(1234) is valid according to Ryan. Again, I don't want to pass a value to the $page variable in my include file, but to the $page->title variable. The above was just an example to explain how I usually work with includes.
  23. I don't want to change the $page->title variable of the page I'm on, but the one that's included in the teaser-event.php. I usually set up my includes/components/partials/whatever to simply use the $page->title variable instead of making a $title variable. Because often, that's exactly what I want the includes to do. And if not, I just override the $page e.g. like this: <?=wireRenderFile("components/sub-nav", array('page' => $pages(1234)))?> I hope that was understandable
  24. I'm using wireRenderFile() to include the following teaser-event.php file: <div class="event-teaser"> <?=$page->title?> </div> Now, is it possible to pass a value to $page->title? Because the folling isn't working, as this would expect a $title variable in teaser-event.php. <?=wireRenderFile("components/teaser-event", array('title' => 'New event title'))?> I imagined something like this: <?=wireRenderFile("components/teaser-event", array('page.title' => 'New event title'))?> Am I doing something wrong, or is this simply not possible at the moment?
  25. Btw. I tried it again using pw 2.6.7 dev but the problem persists.
×
×
  • Create New...