By svref on
As far as I can tell, Drupal nodes are URLs with html at the end of them. Would it be easily possible to make a node be a URL with a pdf at the end of it? Or .jpg, or .mp3, or whatever...
As far as I can tell, Drupal nodes are URLs with html at the end of them. Would it be easily possible to make a node be a URL with a pdf at the end of it? Or .jpg, or .mp3, or whatever...
Comments
Not sure I follow you on
Not sure I follow you on this. Drupal nodes are not URLs with a .htm or .html extension. Drupal nodes are "nodes" or dynamically generated Web pages. Drupal is communicating with a MySQL database via PHP to generate the "node" with the content that you post into the node. This is my understanding of it.
So, yes you can certainly upload images, PDFs, docs and other media to your drupal site and embed this into your Drupal nodes and then output it on your site.
Additionally, there's a good overview of Drupal terminology here:
http://drupal.org/node/21951
Hope this helps.
let me try different words
Thanks for asking me to clarify.
Drupal nodes seem to be big records: a URL where to go to 'get' the page, a bit that says whether it's published, a bit that says if it's on the front page, a pointer to the author, and so forth. The URL is interesting, because when you visit it in a browser, drupal crafts a web page and spits it back. The web page's content depends in no small part on the contents of the record, for example, the author's name on a story is usually inserted into the crafted html.
So say I wanted all the metadata to work as normal, only when I go to the URL, I want to configure it to spit back a certain file with a different mime type from html. For example: Pdf. Is this madness??? :)
For my purposes, I woudn't need the spit-back Pdf to depend on the record in any way - it'd just be a static file. Maybe the term for this is "a static website without a CMS".
I'm not really a spitting
I'm not really a spitting specialist, but I'd say we're talking semantics here. "Static", in my opinion, means that a browser loads 1 particular file, which is on your website, and which doesn't change before or after loading. "Dynamic" means that there is no such thing as a "file" or a "page": when your browser makes a request, some php and mysql thingies are fired up, and they return a mixture of content and layout, which is displayed by your browser. A dynamic site can, of course, still make use of "static" files, which reside on the site, and which are called dynamically.
With regard to the pdf, sure, it can be included in Drupal "pages". Make a node, attach the pdf to that node, and that's all. When your node is called, it will grab the pdf and show it - or a link to it, whatever.
ah
> it will grab the pdf and show it - or a link to it, whatever.
Right, there's a BIG difference there!!!
Showing a link to it off in the files/ directory is one thing (easy).
Returning the pdf itself (content-type text/pdf) is something I'm not so sure about.
Displaying a PDF as the content within the home page
I too have been Googling and searching these forums to figure out how
to drop a PDF into a content area such as the Front Page.
If anybody has a few hints, I would greatly appreciate it.
My site is http://ProgressiveTactics.com
The page I would like to display, is http://progressivetactics.com/sites/default/files/PT-website.pdf
I don't want it to be a page of its own, just occupy the front page content.
Am I trying to do something non-standard?
_
In a word, yes. You might be able to convert the pdf to a graphic, but i've not tried it. Another option might be the http://drupal.org/project/ipaper module.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
IPaper
Not a big fan of Flash.
At my real job, IT blocks flash at the firewall.
The guy I am hosting this site for, also works at the same place.
(Not that we spend any time during work on this!)
You are right, the pages could be made into images ...
It should be simpler than that. :(
BTW - a big thank you for your reply
I am still getting used to this forum structure.
I've been spoiled by http://DSLReports.com where I practically live!
another option
You could convert your pdf to a graphic object using pdf2swf. Good luck. I have been searching for the same functionality and it seems to require using the Zend library and some PHP coding. If I find out more I'll post here.
To bad everyone is using
To bad everyone is using nodes for everything. They are usefull, but not used correctly. A pdf file can be seen as a node. Yet it isn't. Just create a table with info about the pdf. Title, download location etc. Whenever the user requests a pdf:
www.site.com/blog/2009/13/02/today-at-my-blog.pdf
It goes through some routing etc, and gets to pdf.php
pdf.php can than get the data from the table and header() forward the content of that pdf with a content type. Optional could be a redirect to the direct download. This is not recommended though.
Converting HTML to PDF
Converting HTML to PDF in PHP is a pretty classic topic, there are many articles talks about it already. All these can be applied in Druapl.
Not sure if there are some Drupal module doing that already (I will keep searching), if no, I'm going to write one. It will basically do something like this:
You can select list of content types to be output as a pdf file. When selected, when you navigate to the corresponding node link, it will just output the node content into a pdf file.
Best Regards,
Jim
Attitude is mind's paintbrush, it can color anything.
I think you might want to try this
Hi,
I just found this module, Printer, e-mail and PDF versions (http://drupal.org/project/print), if it's not doing the things you want, at least we can take a look at the module code and borrow some ideas from it.
Attitude is mind's paintbrush, it can color anything.