How to refresh automatically on a PDF viewer? - pdf

I am editing LaTeX on my Windows Vista systems. Which I am using pdflatex to generate PDF file constantly.
My PDF viewer is Adobe Acrobat Professional 7, I have to close and open the same file each time to get the new look.
Is there any way to keep the PDF viewer refreshing the PDF pages once it changed?

From a question on super user
SumatraPDF is free, for Windows, and plays nicely with LaTeX. It will automatically refresh when the pdf is updated.
It's also portable, which is nice.

The viewer does not regularly check changes on disk, so short answer: no (unfortunately)
You could however, use your browser to see the pdf file, inside your own html 'webpage' that regularly refreshes the page using javascript.
this is how (including buttons for switching between manual and automatic refreshing):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<title>my pdf</title>
<script type="text/javascript">
var timer = null;
function refresh(){
var d = document.getElementById("pdf"); // gets pdf-div
d.innerHTML = '<embed src="myPdfFile.pdf" width="700" height="575">';
}
function autoRefresh(){
timer = setTimeout("autoRefresh()", 2000);
refresh();
}
function manualRefresh(){
clearTimeout(timer);
refresh();
}
</script>
</head>
<body>
<button onclick="manualRefresh()">manual refresh</button>
<button onclick="autoRefresh()">auto refresh</button>
<div id="pdf"></div>
</body>
<script type="text/javascript">refresh();</script>
</html>
Just save this code as e.g. 'pdfrefresher.html' in the same folder as your pdf. As src of the embed object you use only the filename, e.g. 'myPdfFile.pdf' (not disk or directory).
In the code, you can adjust the width and height of the embedded object and the timeout (in milliseconds).

Evince pdf viewer auto-refreshes.
It is an extremely light and free (GNU) pdf viewer that is the default on most linux OS. There is a Windows version also. Although, I have used evince only in linux, I am sure it has the same features in Windows.

Adobe Reader and/or Adobe Acrobat are notorious for not supporting auto-refreshing the view of a PDF which changed on disk.
If you need that, you should switch your viewer.
SumatraPDF is available for Windows and does auto-refresh the view. Should it not work at times, you can simply type 'r' to force a refresh...

For Linux desktop systems, xreader does an excellent job in the "auto-refresh capable" category. Small number of dependencies; not heavily dependent on any particular desktop (ex: GNOME, KDE) either.

For user who are on MacOS you have LivePDFViewer that allows you live update of the view and other additional adds like highlighting changes or images zoom.

Related

Body background style not working in google chrome?

So keeping it simple, I am trying to add a background image to the entire body of a basic software I am designing.
From what it seems, when I use Adobe Dreamwaver (which allows you to see both the code and the live page), there seems to be no issue with the background image, however, when I open the file using localhost (via XAAMP) on Google Chrome, it doesn't load the image.
The specific piece of code, is as follows:
<!doctype html>
<html>
<head>
</head>
<body style="background: url('file:///C:/xampp/htdocs/Mind%20Notes/gradient.jpeg')no-repeat
center center fixed;">
</body>
</html>"
Really basic, but just to illustrate. I have tried using the body-style segment in my main code, but it didn't work. I tried the code, as above, and still got nothing.
I suspect, its an issue with my browser, not any conflicting code, otherwise the simple code above would have worked.
Many thanks
T

Load default system font for UIWebview

I've two views on my view one is a UIWebview and other is a UITextView and I want both of them to display system default font. But, I just loaded a plain HTML text on my UIWebview and loaded another plain text on textview with default system font. On UIWebview it looks like Times New Roman and on textview it looks like Helvetica. Does the default system font differs for UIWebview?
This is the HTML page source that I load and below is a textview that uses system font.
<html>
<body>
This is a sample html Page
</body>
</html>
I presume if you didn't specify the Font name in html it will take default Font from OS. The default font may vary based on OS and browsers. In iOS you can specify the default name like given below:
<html>
<head>
<style type=\"text/css\">
body{font-family: '-apple-system','HelveticaNeue'; font-size:17;}
</style>
</head>
<body>
This is a sample html Page
</body>
</html>
In the above code it will take apple default font. If it is not available it will take HelveticaNeue font.
UIWebView is just a Safari component inside your app. So when you put HTML content into it, you're kind of loading a page.
The default fontface for web content is Times New Roman, so if you want to change it you need to style your HTML content to change default fontface, using the same type as the system.

CFDocument PDF not showing Japanese data

I have created a pdf with Japanese content using CFDocument. But It does not showing the Japanese data. I have used pageEncoding as utf-8. It showing only blank space instead of Japanese data.
I have used the following code,
<cfcontent type="application/pdf">
<cfheader name="Content-Disposition" value="attachment;filename=test.pdf">
<cfprocessingdirective pageencoding="utf-8">
<cfdocument format="PDF" localurl="yes" marginTop=".25" marginLeft=".25" marginRight=".25" marginBottom=".25" pageType="custom" pageWidth="8.5" pageHeight="10.2">
<cfoutput>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PDF Export Example</title>
<style>
body { font-family: Verdana; }
</style>
</head>
<body>
<h1>PDF Export Example</h1>
<p>担当するクライエントの大半は様々な規模の企業だが、カナダの大学や政府関連の研究機関の担当経験もある。
</p>
<h1>PDF Export English Example</h1>
<p>This is an example.
</p>
</body>
</html>
</cfoutput>
</cfdocument>
Please help!
It seems Verdana's implementation when used in PDF doesn't support Chinese / Japanese. However it looks like MingLiU does. I just changed it to use that font, and everything worked OK via ColdFusion 10. It still didn't work in Railo, but I assume that's a Railo problem, not a PDF / font problem.
So, anyway, just use a font that specifically supports the glyphs you need to render.
Something I ran into years ago.
In order to have the Chinese or Japanese characters rendered up
correctly in PDF using and , you should first check what's your
default locale at ColdFusion Administrator -> Setting Summary -> Java
Default Locale. One would have thought CFML will respect custom
locale using setLocale(), but it doesn't.
If it is "en_US", edit /lib/cffont.properties. Otherwise, create a
/lib/cffont.properties.#locale#(e.g. /lib/cffont.properties.zh_TW )
using cffont.properties as reference.
Replace the font(s) after '=' with system's Chinese font (e.g.
MingLiu) for Chinese or system's Japanese font (e.g. MS UI Gothic) for
Japanese respectively, assuming ColdFusion is installed on Windows,
and client has the respective font(s) installed.
http://henrylearnstorock.blogspot.ca/2010/08/how-to-render-chinese-japanese.html

landscape fixed layout epub 3 viewing only 1 page at a time starting from indesign file

I am creating an indesign cs6 epub3 fixed layout with landscape only mode, viewing only one page at a time.
I added the meta
<meta property="rendition:layout">pre-paginated</meta>
<meta property="rendition:orientation">landscape</meta>
<meta property="rendition:spread">none</meta>
and I also specified the width and height in css and each xhtml file with
<meta name="viewport" content="width=1024, height=768" />
I want the document to appear as one landscape page only, not as a two sides book. Does anyone know how to achieve that?
Ensure that the package element within the .opf file includes version="3.0" and prefix="rendition: http://www.idpf.org/vocab/rendition/#.
e.g.
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="bookid" version="3.0" prefix="rendition: http://www.idpf.org/vocab/rendition/# ibooks:http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/">
See Liz Castro's blog post on fixed layouts for more info.
http://www.pigsgourdsandwikis.com/2012/05/readium-displays-fixed-layout-epub-on.html

Show loading gif when downloading pdf

I have a pdf file served via regular html ('a' tag) but it can take a while to download on slow connections, is it possible to add a loading gif so the user knows that something is being downloaded instead of staring at the same page and maybe think nothing is happening?
I tried one of the solutions offered here to preload the pdf and store it in the cache until it is requested, it shows no loading image but the file should load faster:
<script language="javascript" type="text/javascript">
//<![CDATA[
<!--
var pdfLoader = document.getElementById("pdfLoader");
pdfLoader.src = "http://mysite.com/mypdf.pdf";
//-->
//]]>
I'm on a decent connection so I have no way of testing it, should that work as it is or is there another option I can try?
Thank you.