Print all content in aspx page including embedded pdf - asp.net

I have an aspx page that i need to be able to print out. Inside my page i embed a pdf that is displayed using a cdn as the src.
Since it is a pdf and it is embedded but being hosted on another site when i try to print the page even though it displays correctly the element shows as empty. How can i capture everything in the DOM including the embedded pdf?
I have tried to use the jspdf library to no avail.
<embed src='https://image.pdf' style="width: 607px; height: 500px" />

If you are trying to print everything inside the browser window then maybe use print function of window object?
window.print();

Related

Preview PDF in ASP .NET without excuting PDF's embedded JS

I have a problem previewing a PDF, I use an iframe and when certain PDFs (which have embedded JS) show the print dialog automatically.
Code:
<iframe id="Iframepaso1" src="\pdf\test.pdf" runat="server" height="500" scrolling="AUTO" ></iframe>
The PDF has this line:
/Type /Action
/S /JavaScript
/JS (this.print\({bUI:true,bSilent:false,bShrinkToFit:true}\);)
>>
<iframe> has an attribute called sandbox. By default it will:
block form submission
block script execution
disable APIs
prevent links from targeting other browsing contexts
prevent content from using plugins (through , , , or other)
prevent the content to navigate its top-level browsing context
block automatically triggered features (such as automatically playing a video or automatically focusing a form control)
You can remove specific restrictions by supplying special values to it.

Video screen not rendered by html2canvas and jspdf, when downloading the webppage as pdf

I tried to download the web page as pdf by using html2canvas and jspdf. All elements of page like radio button, checkbox and label are rendered well. But if I add the embedded video into the page by iframe, it doesn't render at all.
Is there any way to render the embedded video into pdf by html2canvas and jspdf?
Thanks.
this is the screenshot of web page to be rendered.
And this is one of downloaded pdf.
I'm afraid html2canvas cannot render iframes. It says so clearly in the documentation:
The script doesn't render plugin content such as Flash or Java applets. It doesn't render iframe content either.
You could do this by other means, but not from the client, AFAIK.

How do i avoid a flash of unstyled content (FOUC) on Google Sites

I have placed some custom HTML, CSS, and jQuery inside an HTML box in my google site. but as the page loads, the unformatted content shows for several seconds until the loading is complete. attempts to add the following:
html { visibility: hidden; }
and then turning it back on later in jQuery do not appear to work inside a Google site.
Does anyone have another suggestion?
I don't know if this works on a google site or not, but using
<body style='display:none;'>
and then in the jQuery document ready function place
$("body").show(); has worked for me.
For some reason using style on the body statement works faster than the CSS file even if the CSS file appears in the head section.

Adobe DTM javascript embed without iframe

I have a simple question. I'm looking to embed javascript code that creates some html and displays an image. I know there are options to embed this code as a third party tag as sequential html/JS or non sequential html/JS. Do both of these options create an iframe for that embed code? Is there a way to not be within an iframe?
If the tag has been placed as "Non-Sequential HTML" then DTM outputs the code as an iframe.
"Sequential HTML" type will use document.write() to output the content synchronously.

jQuery Thickbox with .ASHX image handler - shows garbage

I am using an .ASHX handler to return images from my ASP.NET app. When I use the browser to hit the URL directly (example):
http://localhost/myapp/GetImage.ashx?key=12
it works fine... image shows up on the page. but when I use that same link as a target in Thickbox... I get this:
alt text http://franceschina.net/temp/thickbox.png
the distilled version of ASHX the code:
byte[] img = (byte[])pp.PRODUCT_PHOTO1.ToArray();
context.Response.ContentType = "image/JPEG";
context.Response.OutputStream.Write(img, 0, img.Length);
any idea what I'm missing?
http://drupal.org/node/140371:
In the Thickbox module, the main *.js file, thickbox.js does not account for image urls created in drupal, e.g. via /image/view/2321/preview instead of /image.jpg (or *gif or *png). If thickbox.js does not see the file name itself (gif, jpg, png, jpeg) in the link anchor tag (the [a href ...] tag), it will treat the image like another mime type that is not an image. This causes Thickbox to spit out God-awful garbage on top of your page instead of a cool shadowbox (lightbox) effect.
Looks like the same issue you're having.
well I ended up using the iframe option of ThickBox to load my image with another page. I don't love this solution (it requires a separate page and extra code to determine the optimal height/width of the iFrame)... but it works and I don't have any more time to mess with it

Resources