PDF (abbreviation for
Portable Document Format) is a file format developed by the
Adobe company. It can be used for storage of documents independently on software and hardware where the document originated. The
PDF file type may contain both text and images while the format provides identical viewing of such document on any device. The
PDF documents can be cretaed in commercial software
Acrobat by
Adobe, but also in other programs (usually only as export to
PDF).
There are many free PDF viewers available for various platforms, but the best known is the viewer
Adobe Reader. Some active type content (for example interactive forms, 3D graphics, videos, audio, etc.) may not be supperted by many PDF viewers. The PDF format files have the
.pdf suffix. PDF is an open standard that is easily portable (viewing is independent on used software and hardware) and therefore very popular.
1. View file
Examples of opening
Document.pdf file
The example of the PmaWebDir object viewer opening:
Opens Web browser and displays the
Document.pdf file, that is offered by the
PmaWebDir object.
JavaScriptVBScriptSelect and copy to clipboard
var oCreator = Pm.CreateView(null, "/Web/WebDir", "file:Document.pdf", "target:_blank;");
oCreator.Open();
Dim oCreator
Set oCreator = Pm.CreateView(Empty, "/Web/WebDir", "file:Document.pdf", "target:_blank;")
oCreator.Open
Example of file opening by the ShellExecute method in the Edge Web browser:
JavaScriptVBScriptSelect and copy to clipboard
var sPathBrowser = "c:/Program Files (x86)/Microsoft/Edge/Application/";
Pm.ShellExecute("open", sPathBrowser + "msedge.exe", "c:/download/filename.pdf", sPathBrowser, 3);
Dim sPathBrowser
sPathBrowser = "c:/Program Files (x86)/Microsoft/Edge/Application/"
Pm.ShellExecute "open", sPathBrowser & "msedge.exe", "c:/download/filename.pdf", sPathBrowser, 3
2. Print into the file
In the PROMOTIC application it is possible to print by sending the data to a virtual printer (
Windows OS 11/10 contains
"Microsoft Print to PDF") that does not print on a paper but into the file.
In
Windows OS
8, 7 and older systems it is necessary to install another third party software.
Print panel with printer selection:
JavaScriptVBScriptSelect and copy to clipboard
pMe.Root.Print("");
pMe.Root.Print ""
3. Saving into the PDF file
wkhtmltopdf is open source (
LGPLv3) command line tool for rendering HTML pages into
PDF using the
Qt WebKit rendering engine. This run entirely "headless" (no
GUI). This software tool can be used for saving the content of PROMOTIC HTML pages into
PDF.
Note: This software tool so far cannot save the content of the trend viewer (curves).
Saving the panel by means of open source (LGPLv3) tool wkhtmltopdf as PDF:
Command example from the command line:
C:\Program Files\wkhtmltopdf\bin>wkhtmltopdf.exe --debug-javascript --javascript -delay 5000 --orientation Landscape http://localhost d:\pmc.pdfe.pdf