Search the Community
Showing results for tags 'pdf'.
-
PDF Fieldtype/Inputfield Module for ProcessWire allowing you to easily generate thumbnails of the PDF files embedded to the site. Current version: 1.1.2 (Changelog) Module page: http://modules.processwire.com/modules/fieldtype-pdf Github: https://github.com/uiii/ProcessWire-FieldtypePDF For detailed instructions see: https://github.com/uiii/ProcessWire-FieldtypePDF/blob/master/README.md
- 86 replies
-
- 22
-
Hi again, after trying pages2PDF, RockPDF and mpdf I'm not sure which of them I should use. Of course, there is also wirePDF. I merged mpdf with rockPDF, add a footer and a page in Landscape and that works, like in the code-snippet below but be am I on the right way? After that I tried a couple of times rendering an image. Nothing happend, the same with Pages2PDF too. I also copied an Image-URL within processwire and tried further getting an Image within the PDF-Document, but it still display only the red marked placeholder. I simply would like create an PDF on click from some Pages including the Images. Are there special requirements on Debian 10 with Apache and php 7.3 using Processwire 3.0.123.? Is there a guide that I didn't found? Is somebody out there who has a similar issue solved and would you be so kind to explain? $pdf = $modules->get('RockPdf'); $mpdf = $pdf->mpdf; # $mpdf->showImageErrors = true; $pdf->set('SetHeader', 'header text'); $mpdf->AddPage('L'); # $mpdf->Image(urlencode('site/assets/files/1845/image-2.275x200.jpg'), 0, 0, 210, 297, 'jpg', '', true, false); $pdf->set('SetFooter', ' <table width="100%"> <tr> <td width="33%">{DATE j.m.Y}</td> <td width="33%" align="center">{PAGENO}/{nbpg}</td> <td width="33%" style="text-align: right;">whatever</td> </tr> </table>'); $pdf->show(); // generate pdf
-
Chäs & Co is a b2b cheese trader. They love good cheese and are proud of their excellent knowledge und connections to small cheese producers. They maintain a custom made database and used to copy/paste (!) the cheese infos to the former CMS (Contao). Since substituting the database with ProcessWire was no option, they export now the database to a csv file and import it to the new website (expanded version of module ImportPagesCSV). From there, the pw magic begins. The staff works with the admin interface: They search and find products in notime using the build-in search field (using cheese names or id. Using ids only possible by adding hook, see this forum thread). They generate price lists easily based on a template, providing checkboxes and option buttons for some restrictions, choose i.e. the cheese origin and price audience (all implemented as page selectors). By saving the page a PDF list gets generated (using mpdf, a php pdf library). The visitors can sort and filter the products using a form by shuffle.js. Product details are shown in a popup (fancybox). There's also the option for generating a nice pdf data sheet. No CSS framework being used. Other modules used: ProcessJumpLinks, ProcessProMailer, ProcessWireUpgrade. Visual design: Nicole Haller
-
Hi all, I am having some issues uploading a PDF to our website (a problem we’ve had before). I have tried reducing the size of the PDF but the problem seems to be with generating the thumbnail image because the upload works under the Fallback mode but the thumbnail is terrible (see attached). Does anybody have any advice about this? Please note that I'm not a developer. Thanks!
-
Hi everyone. I can't see the PDF uploaded via a field called "pdf". I get a url like this: http://localhost:8888/mywebsite/site/assets/files/1129/test.pdf%EF%BB%BF%EF%BB%BF Could anyone help me? Thank you. <?php foreach($page->case_studies as $item) { if($item->type == 'contenuto') { echo " <a class='btn btn-primary btn-sm' target='blank' href='{$item->pdf->first()->url}' role='button'>Download</a> "; } } ?>
-
Hello All, I am trying to upload multiple PDF files into one repeater field. The exact situation is, if someone submits the form. make newItem in repeater add all the PDFs in newItem. every thing is working without repeaters(files not getting replaced). But in repeater, only last file remains exist.Other PDFs getting replaced from the newItem field of repeater. My code looks like- $p2= pages->get($id); $pdfs = new WireUpload('f_plan'); $pdfs->setMaxFiles(8); $pdfs->setOverwrite(false); $pdfs->setDestinationPath($upload_path); $pdfs->setValidExtensions(array('pdf','xps')); // execute upload and check for errors $pdf_files = $pdfs->execute(); echo count($pdf_files); //count is working if(!count($pdf_files)) { $pdfs->error("Sorry, but you need to add a photo!"); return false; } foreach($pdf_files as $filename) { $p2->of(false); $new_rep = $p2->floor_plan_rep->getNew(); $p2->save(); echo $pathname = $upload_path . $filename; //all the urls are okey $new_rep->floor_plan = $pathname; $p2->save(); $p2->of(true); unlink($pathname); } Also it is making one extra blank repeater field inside repeater.(I know something is wrong and something is missing in my code. ). Please help. Thanks
-
Hi, I can't get this script to work. I'm simply trying to generate the first page of a PDF from a file fieldtype. I keep getting an error message like this: "Error: Exception: Unable to read the file: …". The path to the PDF seems correct to me. foreach($page->datei as $publikation){ if($publikation->ext === "pdf"){ $file = $publikation->url; $im = new Imagick(); $im->setResolution(300, 300); $im->readImage($file . '[0]'); $im->setImageFormat('jpg'); header('Content-Type: image/jpeg'); echo $im; } } Any idea what I'm doing wrong here? Thanks!
-
CKEditor - PDF upload module (like image upload)
zlitrox posted a topic in Module/Plugin Development
Hi! I'm relatively new to the world of Processwire, but so far I'm really impressed by this CMS and its ease, power and speed. I've been looking at the different field types and also existing CKEditor modules (pwimage and pwlink). Here's what i want to achieve: I would like to use or create a own module which allows my admin users to upload pdf files inline in a CKEditor field (page content) the same way images are handled. It should be possible to upload a pdf file and specify its name and from the file uploaded and name i want to show an icon or image inline in editor and the output for that upload should be customized based on the module. Lets make it simple and say that i upload datasheet-1.pdf and want it to be named "My product datasheet", i want the output to be: <a href="{ link to uploaded pdf file }">My product datasheet</a> Also the uploaded pdf files should be related to the page the user is editing. Is this doable? Any guidance would be greatly appreciated! Thanks in advance. PS. I'm a PHP programmer so i know it would require some custom code, but the real question is where do i start, what should it take and is it even possible to do?- 5 replies
-
- ckeditor module
- upload
- (and 5 more)
-
Hello everyone, I have not really found a lot on this in the forums, maybe someone can point me it the right direction. I would like users to be able to upload PDFs. So far I have come up with the solution to allow the .pdf extension for image field uploads and then the user can insert a link to the file in the main content field, using the editor. This works reasonably well, only thing is the pdf-files are listed in the "insert image" dialog window. I suppose I can live with that if there is no better solution. The only thing is they mess up the nice grid view provided by the Collage Plus module. It is probably not so hard to fix this, but before I invest energy here I would like to ask if anyone has more elegant solutions for PDFs...
-
Hi, I wan't to send a generated PDF with in an email attachment. To sent the email, I have to generate and save the PDF file. I' don't need it afterwards, zo I want to remove the generated PDF after some time. In the documentation i found there's a tempDir() method, but I can't get it to work. I use the dompdf library to generate a PDF This is my current test code: $dompdf = new Dompdf(); $dompdf->loadHtml('hello world'); // (Optional) Setup the paper size and orientation $dompdf->setPaper('A4', 'landscape'); // Render the HTML as PDF $dompdf->render(); $wireTempDir = files()->tempDir('test'); $output = $dompdf->output('test.pdf'); file_put_contents($wireTempDir, $output);
-
Hello PW Community, Do you know how to export current page's map as a pdf? Extended explanation: I have a template which has lots of fields, among which there is a field "geolocation" populated by the googlemapmarker module. Now, I wish to export the whole template as a pdf (with pages2pdf module), but the normal code that works on the ordinary pw's templates does not seems to work within the Pages2pdf dedicated templates. Below the code (working but not producing anything within Pages2pdf module): // alternative 01 <?php $map = $modules->get('MarkupGoogleMap'); echo $map->render($page, 'geolocation'); ?> // alternative 02 <?php $page = wire('page'); $map = $modules->get('MarkupGoogleMap'); echo $map->render($page, 'geolocation'); ?> Thanks in advance!
-
On my website, my boss wants to put a catalog file. That isn't the problem. But since we are distributors, our customers want a catalog with their own logo. Is there any module or something like a module which can make that true? Maybe with a small in-file editor too?
-
I've been investigating a problem that exists with people running not-the-latest Android tablets or phones. I am running PW 3.0.32, ProCache and Let's Encrypt SSL. Regardless of having nginx or apache web server the same problem exists. User clicks on a pdf link from my site, all they will get is blank screen. Nothing happens. No entries are found in either access or error logs or PW logs. This problem exists with Android stock browser and Chrome on Android version 4.4.2, but not with (latest version of) Opera on the same device. Maybe needless to say, but I cannot reproduce the error with iOS or OSX versions of the common browsers. Maybe this is has nothing to do with PW, but I was not able to find any applicable sources for investigating the issue. So any help or pointers would be appreciated. Thank you in advance :).
-
Hi there, I am using the following template file to provide a pdf download, of a pdf stored in a file-field. <?php $file = $page->pdf->filename; header('Content-Type: application/pdf'); header('Content-Disposition: attachment; filename="'.basename($file).'"'); header('Content-Length: ' . filesize($file)); readfile($file); If template caching is disabled, everything working as expected and the following header is sent HTTP/1.1 200 OK Date: Fri, 26 Feb 2016 13:03:27 GMT Server: Apache X-Frame-Options: SAMEORIGIN Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-Disposition: attachment; filename="anyfile.pdf" Content-Length: 909233 X-XSS-Protection: 1; mode=block Keep-Alive: timeout=2, max=1000 Connection: Keep-Alive Content-Type: application/pdf Using Template cache the header is overwritten by HTTP/1.1 200 OK Date: Fri, 26 Feb 2016 13:06:11 GMT Server: Apache X-Frame-Options: SAMEORIGIN Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache X-XSS-Protection: 1; mode=block Vary: Accept-Encoding Content-Encoding: gzip Keep-Alive: timeout=2, max=1000 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=utf-8 Any ideas to prevent this?
-
Working on a site at the moment with lots of PDF downloads and was wondering how you handle these? In my ProcessWire projects so far, each PDF has generally be restricted to a single page. I normally create a field called Files and reference that in any CK Editor links. The problem I realised is that when one of these PDFs needs replacing, my client needs to remember every page where the PDF is referenced. With this site I'm currently building, I have multiple pages referencing the same PDF(s). In the CK Editor modal for linking files, I can of course choose a different page where the file "lives". I'm starting to wonder though if I should create a virtual Files directory which would simply be a container page with each sub-page representing and named after a file. This way, when my editors need to replace a file, they just need to replace and update in a single location. Any known cons of doing it this way?
-
Hi, I am trying to display PDF pages on different parts of my webpage I am creating. Failed to load PDF file ********************************************************************************************** on my showPDF template, i have: $filePdf = $page->showPdf->filename; on my main.inc: if($filePdf){ header('Content-type: application/pdf'); header('Content-Disposition: inline; filename="' . $filePdf . '"'); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . filesize($filePdf)); header('Accept-Ranges: bytes'); @readfile($filePdf); $filePdf=''; } else{ echo $content; } ********************************************************************************************** I must be definitely doing something wrong!
-
You want to display pdf files as pages in frontend? Go here: Create a template file 'showpdf.php' <?php $file = $page->pdf->filename; header('Content-Type: application/pdf'); header('Content-Disposition: inline; filename="' . basename($file).'"'); header('Content-Length: ' . filesize($file)); readfile($file); Create field 'pdf' of type file and add it to your template. Create a page using the template 'showpdf.php' Add pdf to page field 'pdf'. Done. To get save option instead of display use 'attachment' instead of 'inline' like header('Content-Disposition: attachment; filename="' . basename($file).'"');
-
Hello , i am working on website where i need to upload PDF file with each product, its pretty standard i think here is what i am doing 1. i have created a new file type field name "pdf_file" and assign it to product template. for showing PDF file in website , after searching this forum i have come to this solution , please guide me if its wrong. 1. i have created a new template name "pdf" 2. i have created a new page from "pdf" template and its url is "site/pdf", also i have allow the URL Segments. 3. now from my product page i have created a link to open pdf file like this "site/pdf/page_id" 3. in "pdf.php" file i have bellow code <?php $pfile1=$input->urlSegment1; $pfile=$pages->get($pfile1); if($pfile->pdf_file->url){ $options = array( 'exit' => true, 'forceDownload' => false, 'downloadFilename' => '', ); wireSendFile($pfile->pdf_file->url,$options); } when this page open i got following error Error: Exception: File does not exist (in /Applications/XAMPP/xamppfiles/htdocs/site1/wire/core/Functions.php line 536) #0 /Applications/XAMPP/xamppfiles/htdocs/site1/site/templates/pdf.php(18): wireSendFile(‘/site1/site...', Array) #1 /Applications/XAMPP/xamppfiles/htdocs/site1/wire/core/TemplateFile.php(169): require('/Applications/X...') #2 [internal function]: TemplateFile->___render() #3 /Applications/XAMPP/xamppfiles/htdocs/site1/wire/core/Wire.php(365): call_user_func_array(Array, Array) #4 /Applications/XAMPP/xamppfiles/htdocs/site1/wire/core/Wire.php(320): Wire->runHooks('render', Array) #5 /Applications/XAMPP/xamppfiles/htdocs/sit1/wire/modules/PageRender.module(356): Wire->__call('render', Array) #6 /Applications/XAMPP/xamppfiles/htdocs/site1/wire/modules/PageRender.module(356): TemplateFile->render() #7 [internal function]: PageRender->___renderPage(Object(HookEvent)) #8 /Applications/XAMPP/xamppfiles/htdocs/sit1/wire/core/Wire.php(365): call_user_func_array(Array, Array) #9 /Applications/XAMPP/xamppfiles/htdocs/s This error message was shown because you are logged in as a Superuser. Error has been logged. i am not sure i am doing proper & secure way to display PDF file on website. as i said earlier what i actually want to do is Display PDF file in new tab when click on PDF icon from website in secure way. Thanks for helping always.
-
Hi ProcessWire's, how are you all? I've been postponing it for months, but I think the time has come to try to look into this issue a little deeper. I currently have a website http://www.tearoffflyermaker.com/ built in Zend that is getting some traction and about 10 new users a day and I'd love to give this a little more attention! The problem is that it was coded on Zend by a dev in Russia that is gone, has a rather simple "Generating PDF" functionality (with some kind of Zend plugin he used) and some pre built PDF Flyer themes that I'll also have to improve ASAP. I'm perfectly aware that ProcesWire would have the ability to mimic all of that and I'm pretty sure it could replace that heavy Zend to make this app work a litttle better and give me more control about what's going on (since I know nothing about Zend). The only problem, and you hear that a lot, is that I'm not a hard core dev and haven't found many case studies or guides to create apps using Pwire. I would also have to research and undertsand what the optios to generate PDF's from limited user data input there are out there. Would someone be able to help? At least point me to some how-to's on building apps with PW? And yes, I'm also thinking in having a real coder help me with that soon, but I also love to explore myself and understand what's going on under the hood. Tks in advance for your help and sorry if this is a little overwhelming! Cheers! jw
-
Hi, I've created a frontend login form and redirect to a site where I want to offer some PDFs for registered users. I uploaded the files to a fields called pdf_files und looped through them to show them on the site. No Problem so far, BUT: The direct URLs to the PDFs are public reachable. Is there a way to solve this problem? Many, greets, DV-JF alias, Jens.
-
Hi all I am very new to ProcessWire, but have managed to create a content managed site in super quick time! I currently have 2 templates, home and content - that's all I've needed! But now I need to add a new column on the right of my pages that will hold a list of PDF downloads. The list of downloads will be different on each page - some will have a few, some will have none. Each item in the list needs a name, thumbnail image, and document to link to. I was tempted to create a new template for each, but I don't think that's the way to go. Would I do this like a list of news articles? But then I don't know how to specify which 'articles' appear on which page? Any pointers would be greatly appreciated!