How to set height on PDF file when linked to from HTML? - html

I've just created a link which when clicked will take the user to a PDF file.
However when I open the PDF document on the mobile it shows only 3/4 of the page. The rest on the page is just black.
Is there a way in the CSS I can set a default zoom on the PDF?
HTML code:
<a href="privacyStatement.pdf" class="item icon icon-accessory item-icon-right">
Privacy Statement
<i class="icon ion-chevron-right icon-accessory"></i>
</a>

Have a look at this Adobe document:
Parameters for Opening PDF Files
(http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf#G4.1500435)
It describes different ways to set URL modifiers in a HTTP request.
But only Adobe PDF viewers will honor most of them.
Some may only work if the requested PDF is 'web optimized' (a.k.a. as 'linearized').
Some viewers made by other vendors may support some of these only.
You may be able to link to a specific page within a PDF hosted on the web.
So it could open on this page instead of the title page. The page=<pagenum> parameter is meant for that.
For example, try if your viewer jumps from the following link to Page 3 of above PDF Opening Parameter reference.
(The previous link requests the viewer to open the destination PDF directly at page 3).
Other parameters are useful too:
#search=<wordList>.
Example: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf#search="commentID"
#nameddest=<destination>
The PDF of course must contain such a named destination.
Otherwise it will not work.
You can create named destinations within a PDF with Acrobat (not with Adobe Reader, though!):
1. Go to the desired location in the PDF.
1. Click 'View > Navigation Tabs > Destinations'.
1. Go to 'Options', choose 'Scan Document'
1. Once scan is completed, select 'New Destination' from the 'Options' menu; then enter the name you want.
Important note: Named destinations are not the same as bookmarks.
There is no documented URL parameter which would link to a bookmark.
#comment=<commentID>
Specifies a comment on a given page in the PDF document.
Use the #page=.... command before this on.
For example: #page=1&comment=fd22-457c-84aa-2cf5bed5-452fde0e.
Zoom
Yes, you can also request a zoom level on a specific page:
#page=3&zoom=100
This would request a 100% zoom level for page 3.
#page=3&view=Fit
This is probably what you want!
It asks to display page 3, with its contents magnified just enough to fit the entire page within the window both horizontally and vertically.
If the required horizontal and vertical magnification factors are different, it uses the smaller of the two, centering the page within the window in the other dimension.
However, if it works is fully dependent on the viewer software, there is no guarantee for it to work. Good luck with that!
More details in the initially linked Adobe PDF file....

Related

Clicking href links to pdf pages sometimes takes you to the previous link you clicked (Edge)

We have a place where there are multiple href links that take you to different page numbers in the same PDF document, like so:
href="https://url.website.fake/files/2021-01/documents/a_pdf_file.pdf#page=39"
The tester reports that sometimes if they click on link A and then link B, where both links are like the one above but going to different page numbers, the second click will take you to the page number from the previous link.
I've been trying to reproduce but can never do it. The tester is able to reproduce fairly easily. Does this sound like anything anyone here has experienced? Tester has only been able to reproduce this in Edge. Thanks.
All browser users are different, so too may be their PDF extension, thus in this case seems they may not have adjusted their Edge viewer use to same as yours. Other browsers have different methods but effect can be the same. You need to educate users to change their browser security.
Check the second setting.
Most likely theirs is On and yours is Off
its included in how to handle site response such as the download to view.
Using a simple two page file attempting to swap href Sometimes (but not always) throws me a warning
so asking for page 1, I see page 2
if I switch it off and refresh I will see Page 1
For web secure use it is best set On, however for local personal use I tend to switch it Off. Most other users would possibly prefer it On to continue at the page where they last read up to.
My MWE which shows above behavior is
<html><head></head>
<body>
link A (page 2)<p>
link B (Page 1)
</body></html>
link A (page 2)
link B (Page 1)

ODT file opening as left aligned page

I'm writing into a file with some HTML table content.
Now when I save it in .doc extension, then while opening it with Libre writer shows the content in center of the page.
But same when I save it with .odt extension the page shows at the left side of the window. Why this is happening and how can I bring it to center?
Go to Tools > Options... > Load/Save > General and make sure Load user-specific settings with the document is checked.
As far as I've been able to tell, each document will open with the same page view setting as the last saved document of that type unless that option is selected.
If you have a particular document that opens in with a page view setting you don't want, you should be able to change it by clicking the 'Single-page view' or 'Multiple-page view' icon for the desired page view and resaving the file.

Identical HTML not rendering the same

I have a program that let's people design web pages graphically. Then hitting Publish creates an html file that is supposed to be an exact copy of what they created. The elements created by the editor are HTML elements. Publish then gathers up all the elements that have been created and for each one adds it to a string with
canvasOuterHTML += clone$[0].outerHTML;
So all the styles, text, etc., get put on the string. This string, along with some other information is written to the .html version of the page, and when this .html is loaded into a browser the browser displays the page!
But something is expanding the published page vertically. I've created the simple page below to illustrate. The first image is the page in the editor. The second image is what the html displays in the browser.
I'm completely stumped because the HTML and CSS for the two markups is exactly the same, so how can one be higher? I can't even think of a mechanism that would do that. Does anyone have any ideas? Thanks.

When editing an embedded google doc, a blanc drive picker is shown when wanting to insert a image

This case is about embedding a document in an iframe on a webpage. The document loads correctly. The end user should be able to edit the document. But when the end user wants to add an image by clicking on insert > image, he gets the a blanc popup.
<html>
<body>
<iframe src="https://docs.google.com/document/d/101KCoVpNM1QTXIILePLDE0GSPbrb5LGidnbF0iFSEos/edit" width="600px" height="600px" />
</body>
</html>
selecting insert > image
the blanc drive picker
First, please make sure that you are inserting a supported image file type as enumerated in Importing to Google Docs types. For images, you can use the following:
JPEG
PNG
GIF
BMP
PDF
Next, you may want to check the following forum threads wherein the required settings were given and also the guidelines on how you can properly insert images.
Insert Image -> just blank (does not show, except in print preview)
Insert Pictures Do Not Preview or Print Out
Lastly, you may want to also check the response in this related post wherein it was suggested that you may publish the document as a web page and get the image URL from the source of the resulting web page since Google Docs inserted images doesn't have a URL that users could get from the edit view.

Web browser Automation Selecting a Link

Is it possible to click on a random <a> from a loaded HTML document in embedded webBrowser in my form? I'm using VB.net
I'm in a spot of bother. I've managed to get the Webbrowser to navigate to the page I want to be on, now i want it to invoke with page elements.
This is where it gets odd ok, sorry.
I have a rich text box of urls (these URLS are user inputted and match the links on the page I've already navigated to.)
I'd like to select a url at random from the richtextbox (up holds up to 10 lines) then find the href= on the page and invoke the <a>
Is this possible?
If I understand correctly, you have the webBrowser control with the current page loaded, and you want to select from the textbox a link to navigate to.
So you have the WebBrowser.Document.Body.InnerHtml property where you have the HTML of the loaded document, so i guess you can search that to match the input from your text box and with the url from the href call the Navigate method.
Hope that helps
WebBrowser.Document doesn't provide good Intellisense, but you have the full range of dom functions available to you at this point... (eg. getElementsByTag(string); )