
Jason
Staff
/ Moderator

Aug 19, 2011, 9:41 AM
Post #2 of 2
(1060 views)
Shortcut
|
|
Re: [rez] using print.css for pdf?
[In reply to]
|
Can't Post
|
|
Hi, the createPDF plugin will render the page as a PDF exactly how it would look if viewed through a browser. If you need to load a different CSS file when creating the PDF you have a couple of options. You could create a separate template that is used for the PDF. Another option would be to pass a variable to in your URL showing that this would be a PDF. For example:
www.mysite.com/detailPage.php?num=6&pdf=1
You can then use the presence of this pdf variable to determine which css file to load:
<?php if (@$_REQUEST['pdf'] ==1): ?> <link rel="stylesheet" type="text/css" media="screen" href="print.css" /> <?php else: ?> <link rel="stylesheet" type="text/css" media="screen" href="screen.css" /> <?php endif?> Hope this helps --------------------------------------------------- Jason Sauchuk - Programmer interactivetools.com Hire me! Save time by getting our experts to help with your project. http://www.interactivetools.com/consulting/
|