Search the Community

Showing results for tags 'pdf'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • ProDrafts
  • ListerPro
  • ProFields
  • ProCache
  • Form Builder
  • Likes
  • ProDevTools
  • Custom Development


There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 17 results

  1. 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!
  2. Richard Jedlička

    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: Github: For detailed instructions see:
  3. 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?
  4. 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...
  5. 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);
  6. 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!
  7. Harmen

    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?
  8. 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 :).
  9. 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?
  10. 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
  11. 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?
  12. 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 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!
  13. kixe

    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).'"');
  14. mrkhan

    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.
  15. 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 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
  16. 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.
  17. gnome

    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!