I am using php language. I project i have the application to be print, It contain two pages. According to the data available the page content may be change, so printout of first page end and second page starting content not to be proper.
So i want to know any other way is there, to separate the specific content to be printed from the second page ?
What you are looking for are the CSS page break properties. The w3schools.com site has usage guidelines for the commonly used page-break-after property.
I applied all the css method, but not get proper solution. I manually calculated and left the space for this depending on the condition. So i solve this problem with correct result.
Thanks for everyone those who guide and answer for this issue.
Related
I would like to test if the user's browser window.width is >= 800px
if so i would like to render partial A otherwise if window.width >= 800px.
I have little experience, please explain my options on implementation:
I am expecting either a javascript method on the page or jQuery.
I have tried
http://scottwb.com/blog/2012/02/23/a-better-way-to-add-mobile-pages-to-a-rails-site/
but
1. it doesn't work for me.
2. even if it did I expect it will work based on device being used, not pixel count.
Thank you in advance!
You could use Ahoy. The current_visit method contains the following information.
When someone visits your website, Ahoy creates a visit with lots of
useful information.
traffic source - referrer, referring domain, landing page, search
keyword location - country, region, and city
technology - browser, OS,
and device type
utm parameters - source, medium, term, content,
campaign
A request won't contain data about screen size, so in common sense the sever has no way to know what is screen width and what response to serve, as PinnyM also mentioned in comment.
A general practice is to use User Agent to detect mobile device from server. User Agent is part of request. It's not 100% accurate, but it's something you could still depend on for most cases.
However, there is still solutions for your question - serve page based on screen size.
The workaround is to use Javascript to detect screen size at first, then use JS to drop a cookie. Server is able to read the cookie and decide which template to render.
The basic repo is here: https://github.com/mattstauffer/Simple-RESS It's for PHP, but you can get the idea from the source code.
There is also Rails implementation: https://github.com/matthewrobertson/ress, and the introduction: http://matthewrobertson.org/blog/2013/02/15/introducing-ress/
My opinion: I don't like this solution though it is viable. Lots of works to do and lots of things to taking care of. I would rather user User Agent detect instead.
Sounds like using a responsive front end framework might be something to look into. I'm a big fan of Foundation, it's super easy to use it with Rails apps. And the new version of Foundation just launched today! Check it out: http://foundation5.zurb.com/
Okay, i'm extremely new to this sort of thing, so i am probably using incorrect terminology, but i've been trying to find an answer and can't, so i'm asking here!
I have a website made in Tumblr that opens post content inside an iframe. However, that means my parent url doesn't change according to the iframe content. Is there a way i can cause the parent url to change according to the post inside the iframe? On other sites i have just done this manually but it needs to happen automaically here.
Help! Thanks!
I think you could achieve this on a website using a trick to manually modify the address in the URL bar without reloading the page. See this question for more information. Unfortunately I am not familiar with how Tumblr works internally so I wouldn't be able to say if you can actually use this. But it seems like the only way to achieve what you want.
I need to remove the header and footer (date, page title, url) inserted by the browser when printing. I know it can be done on the client by configuring the browser, however this not an option. I know everyone says it is not possible.. But there must be a way to do this with javascript or some server side coding or something else? Does anyone know of any kind of solution?
I don't believe this is possible in almost any scenario. The information is added BY THE CLIENT. Thus if there is no way for you to configure your clients there is no way to remove the information.
My best advice would be to offer the information as a PDF rather than a page that the browser modifies.
I'm having the most peculiar problem, and I was hoping I someone could point me in the right direction on how to address it (or even locate it...). I'm working on a rails site, and the pages display in most browsers without any issues. In others (AOL, IE 6 - 7, and some of the other lesser used ones) the page will load, with all of the correct formatting, but completely missing the inside content.
For example, the site uses a traditional online store format, but will load the name of the site, the name of the product, and the page footer, but not the description or images. This issue has been reproduced on several computers, but I can't figure it out at ALL.
Thanks for any help!
My approach to this sort of problem would be to use the browser to get the html you are trying to render (in firefox, View>>Page Source), and saving it as a static html file. Then you can fiddle with this file one piece at a time until you figure out what's throwing IE for a loop.
If you view the page source is the data you are looking for included? This can help you figure out if you have a formatting issue on the client side or a data generation issue on the server side.
I have seen examples of printing from a windows application but I have not been able to find a good example of any way of doing this.
I've used the print style sheet
here's and article http://alistapart.com/stories/goingtoprint/ that will go through the way to set that up. Rather than setting up a special page that would need to be maintained as well.
If you just need to print your web page from the client-side use window.print(). Sample could be found here: http://www.javascriptkit.com/howto/newtech2.shtml. I would suggest preparing a special version of your page first with no dynamic content and with a layout which would look nice on print.
If you need to send something to printer on the server-side that would be a little bit more complicated. Check out this MSDN article on how to do the basic printing.
The browser prints your pages. If you need to tweak the page so it looks better on the printer, use CSS #media selectors.
Restating what others have said, you just need to call window.print() in javascript. That and build a separate css for print.