Viljami Kuosmanen
Forum Replies Created
-
Glad you could make it work!
I think the issue lies with how you define your custom rewrite rules. Please refer to the official WordPress documentation on the recommended way of how to add rewrite rules to your site.
http://codex.wordpress.org/Rewrite_API/add_rewrite_rule/
Cheers!
Forum: Plugins
In reply to: [WordPress PDF Templates] Cookies & ContextThis really is quite odd. Did you ever find the source of that cookie?
Anyways, I’m Glad you found the issue. Marking this thread as resolved now!
Cheers!
Forum: Plugins
In reply to: [WordPress PDF Templates] Multiple PagesThanks for checking out our plugin!
1. Yes. There’s a media query for that.
@page { margin: 0; }
2. Yes. This is automatic and enabled by default with DOMPDF.Check out the header stylesheets in this example for more info: http://vetrospace.com/en/solutions/wall/pdf-template/
Feel free to ask for advice if you would like any. I’d be glad to see what you do with this!
Cheers!
Forum: Plugins
In reply to: [WordPress PDF Templates] Cookies & ContextHi!
Thanks for using our plugin.
Sounds like there’s an issue with the HTTP headers that the plugin is trying to send. Probably something wrong with the Cookie header. Could you capture the actual HTTP request that the code generates when a 400 error occurs?
1. You should define the FETCH_COOKIES_ENABLED and other plugin related constants in your wp-config.php so it’s retained during plugin updates.
2. You could directly filter out the $_COOKIE array at an earlier point of wordpress code execution as a hack to this problem. Any action hook before
template_redirectwill work fine for our purposes.Let me know if any of this helps. Please let me know if you find the problem causing a 400 error in the plugin. It sounds like something that needs a patch within the plugin code itself.
Cheers!
Antti
Forum: Plugins
In reply to: [WordPress PDF Templates] Under Construction PluginHi!
I’m glad you found a solution!
The plugin requires the ability to load the pdf template as a http request. That’s why you have to allow http access from localhost.
Antti
Forum: Plugins
In reply to: [WordPress PDF Templates] Using Existing FilesHi!
No, unfortunately that’s not within the realm of possibilities with the DOMPDF library this plugin uses.
Please do let me know if you find anything that could provide this sort of funtionality. It would definitely be nice to be able to use external tools to create pdf layouts with dynamic content.
Thanks for checking out our plugin!
Antti
Forum: Plugins
In reply to: [WordPress PDF Templates] Cache ProblemHi!
Thanks for using our plugin.
There is a cache and you can disable it with
define('DISABLE_PDF_CACHE', true);in your wp-config.php.Cheers!
Forum: Plugins
In reply to: [WordPress PDF Templates] Failed to load PDF documentMarked topic as [resolved] due to inactivity on the part of the original poster.
Forum: Plugins
In reply to: [WordPress PDF Templates] Multiple Size and Look DocumentsHi!
Sorry for the late response.
You can use default WordPress functions to conditionally include stylesheets into your templates.
Example:
<?php if(is_page('sample-page')) : ?> <style>body { background:black }</style> <?php endif; ?>Let me know if you would like further assistance.
Cheers!
Forum: Plugins
In reply to: [WordPress PDF Templates] Another Dynamic Content ProblemHi! Sorry for the late response.
You’re experiencing this probably because cookie headers that contain user login information are not being forwarded to the template.
You could try if
define('FETCH_COOKIES_ENABLED', true);solves your problem.Let me know if you still need assistance.
Cheers!
Glad to hear you got it working!
I think the static javascript option would have worked as well. Your logic seemed to be a bit faulty. This piece of script would’ve also worked:
<script> if ( window.location.pathname.match(/pdf-preview/g) ) { window.print(); } </script>[marked topic as resolved]
Another thing you could do, is define a completely new endpoint or use the /pdf-template endpoint instead of /pdf-preview, and look at the user agent.
The
$_SERVER['HTTP_USER_AGENT']variable shouldn’t be defined when the request is coming from /pdf-preview or /pdf, but should be defined when using /pdf-template.How about just adding the <script> tags statically into the template? The PDF document can’t render it anyway.
Ahh, you’re completely right. The plugin externally loads the /pdf-template endpoint and renders it onto the page.
I can’t immediately think of a way to differentiate between the /pdf and the /pdf-preview endpoints without altering the plugin source. This may well be a feature I could implement in the next version of WP PDF Templates.
This is a bit of a hack, but you could experiment with setting a cookie to track which endpoint is being used. Just add
define('FETCH_COOKIES_ENABLED', true);to your wp-config.php to make sure cookies are being forwarded to the template.Let me know if you have any luck with this method. I haven’t actually tried this myself.
Forum: Plugins
In reply to: [WordPress PDF Templates] Failed to load PDF documentHi!
Thanks for using our plugin!
The URL http://easysafety.creativem.co.nz/employee-induction/pdf-preview/ seems to still work. Looks like DOMPDF is crashing when trying to convert your document to PDF.
Are you using javascript to load content onto the template?
Anything interesting in the PHP error log?