Is it possible to print ID properly straight from the browser? - browser

I wanted to design a simple ID printing software for my company, where I would load a database of entries and generate HTML/php output using a Background image as template, and css/html positioned text for the details and image.
I plan to use it on my own browser, therefore i have full control over the browser print settings..
I actually tried to do a basic HTML page emulating the output and i just can't get it to print right on our Datacard ID Printer (prints directly to PVC ID cards) ..
though i've set the browser (firefox) margins to zero and the print settings to scale , it's either i get a small margin left and top side of the card, or the printer prints out 2 cards (the id spans through 2 or more pages)
Is there ever a way, perhaps the proper browser setting , or registry hack or something that can get my html page to print right on a standard ID size output?
Regards

Related

JMeter - WebDriver Sampler - Autofill name by Google Map

I have a text field for filling the address. When entered few letters and the full wordings of location will be displayed. Normally it allow users to click on the full wordings for autofill the location. And this function is from Google Map. I am not sure how to get the autofill name from default Google Map in JMETER.
When I send keys ("57 Java") to text box, it will display "57 Java Road North Point" under the text box.
WDS.browser.findElement(org.openqa.selenium.By.xpath("//input[#value='']")).sendKeys("57 java");
These "suggestions" are loaded by AJAX technology and being added to the DOM as you're typing.
Not sure about your application, for "normal" Google Maps it can be located like:
//div[#class='suggest']
So these "suggestions" are normal HTML elements which can be "found" using any suitable locator strategy

Automating Chrome Cast Ambient Mode settings or Google Photo Album content

I want to rotate out/toggle two images within my Chrome Cast's Ambient Mode (via Google Photo Album).
Possible routes that I see:
Delete image 1 and add image 2 of an album one day, the next delete image 2 and add image 1.
Each day, switch the selected Album within the Ambient Mode settings.
Methods I see:
https://developers.google.com/cast/, however there doesn't seem to be any mention of settings or ambient mode. I suspect these methods are not public.
ifttt, sadly I don't see anything even remotely along these lines already out there.
Is this possible, where could I look?
The Ambient mode content is managed by the Cast platform based on the selected content you have provided. There isn't an API to be able to control what content is selected to be displayed.

Images in J2me Lwuit

I have developed an LWUIT app. I have two types of images dispayed in the app. One coming from server side that need to displayed (like a photo posted and saved to server side) and one packaged in my jar and displayed mainly as icons (like a music icon, loading animation gif etc). I need to display all images according to the sreen size and resolution. The first kind is displayed by taking the screen display height and width and then use scale method and show a scaled version of the image. But however I have no idea how to show the second kind. i.e. icons. Example, my loading image looks good in most of the phones but for some phones like samsung, it looks blurred and over-sized. How to do this. My basic idea is to keep 3 types of images of icons like icon_width_lowXheight_low.png, icon_width_mediumXheight_medium.png and image_width_highXheight_high.png and show it based on the screen size. Please let me know the bets way to achieve this?
Thanks,
Parvathy
You should use MultiImages which were added in LWUIT 1.5. I don't have a link for this in LWUIT but our work in Codename One is pretty close to this so check out the How Do I? on multi images (and I suggest migration to Codename One regardless).
I think that you will need to use this
Image i = Image.createImage("your image path here");
i = i.scaled(widthValue, heightValue);
And put this values in relation to the Display.getInstance().getDisplayHeight() and Display.getInstance().getDisplayWidth()
Right?

Mobile Safari fails to scroll to named anchor

I have a big SVG document here, containing a map of all the quests in a certain online game. Each quest node is inside a SVG <a> element, linking to a distinct named anchor in a big HTML document that loads in another tab, containing further details about that particular quest. This works exactly as desired in desktop Safari, and I'd expect it to work just as well in any browser that supports SVG at all since I'm using only the most basic form of linking, but it fails badly on Mobile Safari (iOS 6) - which is my single most important browser target, considering that the game in question is for the iPad. It only scrolls to the correct anchor on the initial load of the HTML page; clicking a different quest in the SVG tab will cause a switch to the HTML tab, and the hash (fragment ID) in the address bar changes, but the page doesn't auto-scroll.
This appears to be a known limitation in Mobile Safari - hash-only changes in the URL apparently used to force a page reload, and that got over-fixed such that nothing gets triggered at all now. The fixes I've found online all seem to be applicable only in cases where the URL change is being generated programatically, from within the same document, rather than static links from a different document.
Further details:
I've tried doing the named anchors in both the old <a name="..."> form, and the newer <h1 id="..."> form. No difference.
I've tried adding an onhashchange handler, to force the scrolling to take place, but the handler isn't being called at all (verified by putting an alert() in it).
I could presumably fix the problem by having each quest's details in a separate HTML file, but that would severely affect usability - with all the details in a single file, you can use your browser's Find feature to search through them all at once. (Also, deploying 1006 files to my web hosting after each update would be a bit of a pain...)
Anybody have an idea for a work-around?

Web image display in iPhone app

I am new to developing on the iPhone so am sorry if this is an easy question, but it has had me stumped for a little while.
Basically the app displays data retrieved from an XML feed. In that feed is an element that contains the path to an image. eg http://www.myserver.com/myimage.jpeg.
I want to be able to display that image in the list view of my iPhone app.
Most importantly, I don't want to stop the list drawing for each image, the rest of the data should be displayed immediately and then each image downloads and displays as quickly as data speed etc make it available.
What is the best way of downloading that image and displaying it?
Ideally can someone point to some working example code.
Thanks
Stephen
Displaying the image: you could create a UIWebView and just point it to the path - and then it's fully zoomable too.
Displaying in the list view:
//Somehow download your image...
cell.image = Your Image

Resources