Welcome to the free LT-PGN-VIEWER 2.2
What is a PGN Viewer ?
A pgn viewer (Portable Game Notation Viewer) takes the notation of a chess game and generates the moves of the single pieces, that means it generates the picture of the chess board for every single move. If you want to visualize the moves of a chess game from its notation, you will probably need a pgn viewer.
How do I work with this PGN Viewer ?
First you need a pgn file. Type in the location of a pgn file in the Url input field, for instance kasparov_deepblue_97_2.txt, then click the Open button. The file extension should not be .pgn because some browsers have trouble to open a file with an unknown extension. After that select the moves you want to view (starting with 1.) by mouse (click-drag-release), press Ctrl+C (copy), click with the mouse in the textarea next to the game board and press Ctrl+V (paste). Now click the button [ > ] to play through the game. When you load another game, you have first to click the reset button [ I< ].
Where do I get PGN files ?
There are lots of chess web sites where you can get pgn files for free. Here are some links for chess resources on the web:
How can I use this PGN Viewer for my own web projects ?
You can copy the viewer pgnviewer.zip
to your own site (its free!) for instance to www.my_website.com/chess/pgnviewer/.
Then you need some pgn files, for instance in www.another_website.com/chess/pgnfiles/.
Finally you can refer to it by using html code pgnviewer.html?pgnfile.txt similar to this:
New York 1927 - the famous 6-player tournament with Capablanca a clear
first (14/20) over Alekhine 11.5/20). Included Nimzovich, Vidmar,
Spielmann and Marshall - all 60 games.
If you are familiar with JavaScript you can present your games in a more comfortable way: Open the lite viewer version ltpgnviewer.html with a HTML file in the right frame and control the pgn board in the left frame by
some simple JavaScript commands included in the HTML file - see the lite pgn viewer example !
You can open a new lite viewer window by using the following JavaScript code:
window.open("ltpgnviewer.html?ltpgnviewerdemo.html", "LTPgnViewerDemoWindow", "width=640, height=390, menubar=no, locationbar=no, resizable=yes, status=no, scrollbars=no");
You can also open the pages pgnboard.html and ltpgnboard.html in a new window and pass the JavaScript commands via url
window.open("ltpgnboard.html?SetTitle=A Very Short Game&AddText=<B>Click on the board to make a move!</B>&SetPgnMoveText=1.g4 e5 2.f4 Qh4+&RotateBoard=true&AllowRecording=true&MoveForward=3", "", "width=300, height=440, menubar=no, locationbar=no, resizable=yes, status=no, scrollbars=no");
The commands will be executed in the same order as they appear in the url string. Note, that this will work only via http, not in offline mode.
Since version 2.0 you can generate HTML pages with pgn variants by using the LT-PGN-EDITOR. Because this is a major improvement, I also did a major step with the version number from 1.6 to 2.0 ;-)
If you want to setup the start position (for instance for a chess problem) you can do this the following way:
Click the "Setup Board" button and after this on the board to generate the position you want. Click on "Ready" and
the FEN string will be displayed in the FEN input field. It is assumed, that both black and white can
still castle and that no "en passant" is possible in the first half move. If this is not the case, then please edit the
FEN string by hand (for instance replace "KQkq" by "-" at the end of the FEN string).
Since version 2.2 you can open a pure pgn file and automatically parse the pgn text to generate a webpage with all the games
which are included in the pure pgn file. For instance type in Url input field ny1927pgn.txt click on
the checkbox "parse pgn" and then click the Open button. The file will be loaded in the right frame
and after a few seconds it will be automatically transformed into an html file with select box of all the games.
However, this will work only in modern web browsers. You can also
open the lite viewer version this way:
window.open("ltpgnviewer.html?ny1927pgn.txt&ParsePgn=1", "LTPgnViewerWindow", "width=780, height=400, menubar=no, locationbar=no, resizable=yes, status=no, scrollbars=no");
Where do I get the latest version of the LT-PGN-VIEWER ?
You can look at the homepage of the author for the latest version of the LT-PGN-VIEWER. You can also send an email if you have
any suggestions, bug reports or hints.
What's new ?
- get FEN notation from any position (v. 1.3)
- script file 'ltpgnviewer.js', which loads only once if several pages with PGN viewers are open and can also be used as an engine for other applications (v. 1.3)
- rotate board (v. 1.4)
- record moves: click on a piece and after that on its new destination on the game board (v. 1.4)
- autoplay - back buttons and forward buttons can be used to change the direction (v. 1.5)
- saying "black to move" or "white to move" when not using standard FEN (v. 1.5)
- passing JavaScript commands via url string (v. 1.6)
- generating HTML pages with variants (v. 2.0)
- setup board by mouse click to generate FEN string (v. 2.1)
- display of webpage with games after loading and parsing a pure pgn file (v. 2.2)