Need to print only the frame and not the whole page using Google Chrome - google-chrome-frame

When I try to print the webpage, only the frame appears in the print when using IE or other browsers. However, through the google chrome, the whole page gets printed.
I have done a little research and found out that adding the OpenFrame plugin would do the trick. However, I am looking for the solution without the plugins. Our product is used by a number of customers and we can't ask them to install any plugins.
Can we fix this by making CSS changes or scripts.

Using JavaScript you can print frames independently, e.g.
top.frames[1].print()
If you include a print button or listen to print events, you can call your print function that prints only the frame you want.
Or you can use CSS #media print to set what gets printed

Highlight (select) what you want to print, right-click over the selected area and hit print.
p.s.: No other option worked. The add-on (Chrome app) doesn't have a print option, only open in new window and by doing so it sends a new page request and for many sites it won't work.

The best way is to use this "Chrome App" to add a Context sub-menu to your Chrome.
After the installation right click on the frame you want to print, select [This Frame] and the select the option that fits the best with your situation, usually [Open Frame in New tab].
Once you have the frame in a new tab you simply print it with CTRL-P or Right-Click [Print].

#media print { .div-to-not-print {display:none}}
is problematic because
It's not an end-user solution; it has to be done by the page
developer, and
We're talking about frames, which are actually independent pages.
That sort of solution wouldn't allow a user to print two
frames independently.
The suggestion
Click on the File > Print , then use the option Simplify Page
may work in some circumstances, but, for me, it just removes all frames and reverts to the <noframe> content in the frameset page.
As far as I can tell, there is no decent way to print just one frame in a frameset that is already loaded. A Chrome plugin that I haven't tried called "Print This Frame" really just re-loads the frame in a new tab (with a round-trip to the server).
But, without that plugin, if the frame you want to print was created from a hyperlink within the frameset, you can usually load the frame in a separate tab or window just by right-clicking on that link and selecting "Open link in new tab" or "Open link in new window"

Well the only workaround I could suggest is to open the source of the page and find the section
clink on the link and print it.

You should be using CSS:
#media print { .div-to-not-print {display: none} }
In the print version the blocks with class div-to-not-print will be hidden.

I found one another option useful.
Click on the File > Print , then use the option Simplify Page , that does removes useless things from page.
It might not be relevant to specific page you are printing. But i use it often.

Facing the same problem, I found that the most convenient way to control exactly what I wanted to print, thus remove the adds and various elements that just waste paper was to edit the page source directly:
Inspect the page : Ctrl-Shift-I -> this opens a pane with the source code of the page and the layout
By hover'ing over the source code it is really quick to identify the interesting elements that you are interested in, just remove the other ones:
it is a hierarchical representation of the page layout so you can expand the and elements to have more granularity when hover'ing
you may need to change or remove the class of the elements to change the internal layout if you have removed internal columns for example
Here is an example:

Click on the frame of interest
press CTRL+A (on Windows or equivalent on Mac) to select all content of the frame
press CTRL+P or choose print from the context menu
This should show a preview with everything in the frame ready to be saved as PDF or printed to the printer.

Related

is it possible to scroll to specific position in browsing?

I am no programmar nor tech savvy person myself.
I just wanna know if it's possible to achieve this goal:
The default behavior of the browser(e.g. chrome) is it sends one page up or page down depending on where I click(above or below scroll thumb).
But when clicking somewhere on the scroll track, I wish it navigates right through the target position in the web page.
for better understanding, here's the screenshot of cnn.com main page for reference:
(In first screnshot, I highlighted where I will click.
Second screenshot is the default behavior of the browser as a result.
Third screenshot is what I want realize for my own convenience. it's useful when navigating through long articles.)
I think it is almost impossible to do this on my part because maybe it's hardcoded in browser's engine level or something, but I wanted to make sure it really is.
or any workaround like making autohotkey script or something?
thank you so much!
There seems to exist a trick with Shift, but it doesn't work in browsers.
However, you are manipulating a browser, and browsers have a built-in scripting language — JavaScript. Here's the setup you need to do:
Go to the place on the page you want to scroll to.
Open the developer console (Ctrl+Shift+I and then click on the "Console" tab). This shouldn't interfere with the scroll position.
Type window.scrollY and press Enter.
After that, the console will output the amount of vertical scrolling. In the following AutoHotkey code I'll use 12345 as an example; replace it with the value you have. Note that it also scrolls to the left margin.
Send {F6}javascript:window.scrollTo(0,12345)`%3Bvoid`%200{Enter}
It appears that, due to a bug, this doesn't work in Firefox.
I know your problem, I think chrome must have this config, you can type in the address bar "chrome://chrome-urls" for searching

CPropertySheet: How to get the child page from OnDrawItem

I've added some code as found here Big problems with MFC/WinAPI to colour tab titles the same as the reset of the dialog, which works, but unfortunately all the tabs end up with the same name. This doesn't surprise me all that much as GetCurSel() is used to grab the text to use, and only one tab can currently be selected, but I'm struggling to see how you access the correct tab index from OnDrawItem().
I've googled and had a look on MSDN but don't see how anything passed to OnDrawItem lets you know which tab is currently being drawn, rather all the examples I've seen assume you're only interested in the one currently selected. All I want to do is something along the lines of GetWindowText() on the child window and redraw with that. I'm also unsure of the parent/child/sibling relationship between the sheet, tab control and page - it depends who you listen to.
I should probably add that I'm also unsure why all the tabs are redrawn when I select one. I don't know if this is normal or something specific to this implementation (that's something I'm looking at, but like seemingly everything else in this code base it's multiply inherited several times over ...).
Cheers for any help.
Not to worry, I now realise lpDrawItemStruct->itemID holds the tab index so I can get a handle to the tab using that.

How to Put image or image based text on Navigation tab (bar) in Oracle APEX 4?

Got this basic issue..
I have two tab navigation bar in Oracle APEX 4.0. The parent tab and the standard tab.
The standard tab which is below parent tab starting from left, I would like to put a text or image made of text on the right side which describes the overall application.
The Text or Image of made of text will be "BASIC PROGRAM" in a Green color with big font size.
Can anybody guide me how to proceed..
I was thinking using substitution strings such as #tab_cells# may work, but not sure where to put and how to do it?
appreciate your help..
Tabs are long due an overhaul, the customisation you can do on them is extremely limited. Short of completely overhauling your menu system, i'd alter this one tab through javascript/jquery.
Please take care with selectors for tabs. I have no idea which theme you are using, i did this for theme 21 with 2 level tabs, selecting a 2nd level tab. Inspect your HTML and adapt this to your requirement.
$("ul#tabs li").each(function(){
if($(this).text().indexOf('Maatregelen')!=-1){
$(this).children('a.tab_link').css(
{"background":'url()', "background-color":"green", "text-shadow":"none"}
);
};
});
I wouldn't change the template per se. There is not much you can do there to the tab generation, since you can not use plsql code. Rather, you could put the tab label in an attribute on a higher level than the a-tag, to have an easier jquery selector. Or you can put the javascript code in to run on-load. Or have a dynamic action on page zero to run on-load, and this will affect every tab in each page.

when using yahoo maps the "X" (close button) in the smart window is showing up on the upper left

i am using code right out of the examples in yahoo maps api, but when i click on a smart window i get the close button (x) in the upper left. the only thing i am changing is the html in the smart window but i dont understand why that would affect the location of the close button. also, i dont see any documentation on how to change this on the yahoo maps api web site.
You may want to look in your page CSS for anything that floats img tags left or positions them absolutely (think along those lines).
One debugging method would be to temporarily turn off your page's CSS to see the result.

How to design a linear GUI program

I'm making a simple Qt application. It has 4 screens/pages:
Start import
Select folder to import images to
Accept or reject each image in folder, and when no images left:
"No images left" and an OK button.
I can't figure out the best way to implement this. I started off with a QWidget, but this quickly got unmanageable.
Is a QWizard too constrained?
EDIT: Part of the problem with QWizard is it seems to always have "Back" and "Next" buttons. I don't want those as options in this program, so this leads me to believe that a wizard isn't exactly what I'm after.
I'm going to disagree slightly on using a QWizard here. It would be fairly easy to do, but in this case I think it might be easier to just use a QStackedWidget and swap the widget shown based on what you want the user to be able to do. This is likely what is done inside QWizard anyway, without some of the complication for running the buttons and moving back and forth. You also might want to take a look at the state machine stuff they're looking at adding soon, since you're application could so easily be split into states.
I think a QWizardPage is your best bet.
You can disable the 'back' on a QWizardPage by using setCommitPage(True) on it.
You'll also have to override nextId for the 'variable' amount of QWizardPages you want in between step 2 and 4.
here (basic) and here are examples of QWizards.
You can make QWizardPages for your screens and add them to a QWizard. With registerField() you can register fields to communicate between pages.
EDIT:
I didn't test this, but i guess you can control the button layout of QWizard with
setButtonLayout
Create a dialog with a "Start Import" button on top. When the user clicks this:
Populate a QFormLayout :
The layout should have a checkbox and the label is the name of the picture to import. I'm not sure of your requirements, but you could also display a thumbnail of the image.
The user just checks the images he wants.
Then at the bottom have a "Save..." button. When the user clicks this, a Save As dialog appears. You save all the checked images, discard the others.
If there are no images, change the "Save..." button text to "OK", and display a QLabel with the "No images left" string. You can switch between the QLabel and QFormLayout using a QStackedWidget.
Checkout this article on QFormLayout: http://doc.trolltech.com/qq/qq25-formlayout.html
Option: Get rid of the "Start Import" button. Have the app automatically populate the QFormLayout on startup (possibly in constructor if its fast enough).

Resources