Parametersteuerung in pdfMachine Ultimate
Windows 7 / 8 / XP / 2003 / Vista / 2008 / 2012 und alle x64 bit Systeme
Diese
Funktionalität richtet sich an Personen, die im Umgang mit Computersystemen
Erfahrung haben.
Bei Fragen stehen wir Ihnen auch
per E-Mail gerne zur Verfügung: info@broadgun.de
Mit der Aktivierung der Parameter-Steuerung in den Optionen der pdfMachine steht
dem
Anwender
und Administrator ein mächtiges Werkzeug zur Automatisierung von Abläufen in
Verbindung mit beliebigen anderen Softwaresystemen zur
Verfügung.
Im
Gegensatz zu den am Markt üblicherweise verfügbaren Produkten lässt sich die
pdfMachine vollständig z.B. in ERP Software, Warenwirtschaftslösungen oder auch
technische und branchenspezifische Systemlandschaften
integrieren.
Dabei
spielt es keine Rolle, ob es sich um Programme und Lösungen von SAP, Navision,
MS Business Solutions, Sage, Lexware, RIB Software, Nemetschek, Autocad etc.
handelt.
Ihr
Vorteil:
Der
Anwender benötigt keinerlei Kenntnisse zur Anwendung der pdfMachine, muss sein
gewohntes Arbeitsumfeld nicht verlassen und kann dennoch die volle
Funktionalität nutzen.
Fazit:
Dies ist nur ein kleines Anwendungsbeispiel zeigt aber doch deutlich was wir unter dem Thema PDF verstehen: Nämlich die sinnvolle Integration eines technischen Standards in tägliche Büroabläufe.
Das spart Zeit und Geld!
Das folgende Beispiel gehört in diesem Zusammenhang zu den häufigsten
Anwendungsfällen. Kopieren Sie es und testen Sie:
Eine
weitverbreitete Anwendung ist die Integration der pdfMachine Ultimate in das
ERP-System MS Dynamics NAV.
Dabei
wünscht der Ersteller eines Angebotes oder einer Rechnung per Knopfdruck in
seiner Warenwirtschaft,
den direkten Versand aus seinem Programm heraus ohne das er sich darum kümmern
muss ob das richtige Firmenbriefpapier verwendet wird, eine digitale Signatur
aufgebracht wird um die Rechnung oder das Angebot gegen Manipulation zu schützen
oder ob das Dokument tatsächlich direkt dem Empfänger per E-Mail zugestellt
wird.
#_
email itnt@broadgun.de _#
#_
savepdf c:\testitnt1.pdf _#
#_
StationeryEnableStationeryAllPages 1 _#
#_
StationeryPathStationeryAllPages C:\pdfbriepapier\Briefpapierbroadgun0504.pdf
_#
#_
StationeryOnTopStationeryAllPages 1 _#
#_
emailsubject Broadgun Rechnung Nr. 5983.pdf _#
#_
docname Rechnung _#
#_
emailbody Hallo, _#
#_ embed c:\KurzbeschreibungpdfMachine.pdf
_#
Sollten
Sie weiter Informationen benötigen, so freuen wir uns auf Ihre Nachricht
an
parameter@broadgun.de oder gerne auch telefonisch Telefon +49 208 7803818.
Nach folgenden Steuerzeichen wird
gesucht:
Anfang
#_
Ende _#
Der E-Mailbody kann auch mit einer Besonderheit
gesteuert werden.
Beispiel 1:
#_ EMailbody @c:\text.txt _#
Hier wird als Mailbody die Datei
c:\text.txt eingefügt.
Um nur eine PDF-Datei zu konvertieren und zu
speichern hilft folgender Parameter
#_ SaveFileOneShot c:\x.pdf _#
Anhängen Ihrer AGBS:
Nutzung des digitalen Briefpapiers mit Parametern:
Beispiel 2:
#_ StationeryEnableStationeryAllPages 1
_# //Briefpapier für alle Seiten aktivieren.
#_
StationeryPathStationeryAllPages C:\pdfbriepapier\Briefpapierbroadgun
_#
#_ StationeryOnTopStationeryAllPages 1 _# //
Briefpapier über den Text legen.
Beispiel 3:
#_ AppendFile2 c:\agb.pdf _# //Datei agb.pdf wird
angehängt.
Tipp! Damit die Steuerzeichen nicht im
Dokument erscheinen setzen Sie die Schriftfarbe auf weiss. Ein anderer Weg ist
die Steuerzeichen auf einer separaten Seite zu
platzieren.
Befehle zur Steuerung der pdfMachine
EmailTo
If set provide default values for the
default mail client when it is launched. If the first character is an '@' then
the rest of the text is taken to be a filename and the text is read from the
file.
e.g if the "Email Body" value was
"@c:\body.txt" then the file c:\body.txt would be read in and this would be
placed in the body of the email.
For the TO, CC, BCC
address fields, several addresses may appear if the addresses are comma or white
space separated. Some email applications require the "SMTP:" prefix on mail
addresses to send SMTP style mail.
EmailCC
When an email
is to be sent, this value is used.
EmailBCC
When an email
is to be sent, this value is used.
EmailSubject
When an
email is to be sent, this value is used.
EmailBody
When an email
is to be sent, this value is used.
UserConfirmAttachmentName
If set to 1, then the user is prompted for the attachment name prior
to sending an email.
AutomatedMapiSend
If
set to 1 and a EmailTo entry is present, then the email is sent automatically,
without user intervention.
sd_keyLen
set to either 5 for 40 bit encryption, or
16 for 128 bit encryption.
Zusammenfassung verfügbare Parameter:
Email
Email sending
SavePDF
Save to a file name
AppendPDF
Append a PDF
InsertPDF
Insert a PDF
OpenPass
Set the Open password
PermPass
Set the change permissions password
Stationery
Set or change the PDF stationery
DigSig
Apply the digital signature
Embed
Embed a file
InsertImage
Insert an image
SplitPDF
Split a large PDF into smaller PDF's
bm
Set a bookmark
print
Print PDF to another printer
l
Link. Create a hyperlink.
i
Image button locator
ii
Insert Image
il
Image Link
ilqs
Image Link Query String - Name Value Pair
x_embed
Embed a ZUGFeRD XMLfile
x
Modify a ZUGFeRD XML tag
x_clone
Copy a ZUGFeRD XML tag
After
parsing the parameters pdfMachine will either remove from or leave in the
parameters from the resultant PDF file as selected by the radio buttons in this
dialog.
The
parameter parsing is done using the "Perl-Compatible Regular Expressions"
library developed by Philip Hazel. A regular expression is a pattern that is
matched against a subject string from left to right. For a detailed explanation
of regular expressions, please read:
http://home.att.net/~robertdunn/Papers/RegExpSyntax.html
The
default regular expression used is: #_ (\w+) (.+?)_#
We
recommend this regular expression is not changed without a good understanding of
regular expressions. Should this accidentally be changed it can be
corrected using the default regular expression described on this page.
If
you need to change the regular expression, it is stored under the following
registry entry:
HKCU\Software\pdfMachine\RegExp
The
default regular expression will allow parameters to be entered into the
originating document in the following format:
#_ parameter argument(s)
_#
Note: A parameter and an argument list for that parameter must both be specified, even if the arguments are not used, at least 1 argument must be present.
A
valid entry for setting a digital signature in the PDF file is : #_ digsig 1 _#
An invalid entry for setting a digital signatures is : #_ digsig
_#
2)
Create the originating document with appropriate parameters
The
parameters are not case sensitive. Choose from the parameters listed
below:
Parameter |
Description
|
---|---|
Arguments: Comma separated list of email addresses to send
to. e.g. #_ email dave@broadgun.com _# | |
EmailCC | Arguments: Comma separated list of email addresses to cc to.
e.g. #_ emailCC dave@broadgun.com _# |
EmailBCC | Arguments: Comma separated list of email addresses to bcc to.
e.g. #_ emailBCC dave@broadgun.com _# |
EmailSubject | Argument: Subject of email e.g. #_ emailSubject Your invoice is attached _# |
Emailbody | Argument: Text body of email. May span across multiple lines.
e.g. #_ emailBody Hi, Please find attached a very useful PDF file. Best Regards, The Boss. _# |
EmailAttachmentName | Argument: Name to use for attached PDF file e.g. #_ emailAttachmentName invoice.pdf _# Note: Do not use the following invalid Windows filename characters as they will be removed. \ / : * ? " < > | |
EmailAttachmentsList | Argument: A list of files to attach to the PDF. They must
exist, and have the full path name defined. The list should be separated
by semi-colons with no spaces in between. e.g. #_ emailAttachmentsList c:\invoices\123.docx;c:\receipts\123.pdf _# Note: Do not use the following invalid Windows filename characters in the actual filename component as they are illegal characters for a filename and will result in an error. \ / : * ? " < & &rt; | |
MergeField |
Arguments: fieldname value
The MergeField parameter allows the contents of the Email to be customized to a finer detail. That is, the subject, body and attachment name can be set in the pdfMachine options screens. The {} characters can be used to define field names within these and then the MergeField parameter used to set these field names. MergeField can only be used when the Email parameter is set. Takes a fieldname to replace, and the value to replace that fieldname with. The mergeField is applied to the EmailSubject, EmailBody and EmailAttachment name settings. e.g. #_ MergeField first_name Fred _# This will replace all occurrences of {first_name} in the subject, body or attachment name settings, with the word Fred. |
The following parameters can be used to cause pdfMachine to prepare to email the resultant PDF. The email can then be checked or corrected before it is sent. The EmailTo parameter replaces the Email parameter. The other Email parameters described in the previous table can also be used.
Parameter | |
---|---|
EmailTo | Arguments: Comma separated list of email addresses to send
to. This is used instead of the Email parameter described above. This prefills the email parameter but does not send the email. e.g. #_ EmailTo dave@broadgun.com _# |
NextAction | Arguments: 4 To launch the default email client with the prefilled values set by the parameters a NextAction of 4 should be used. NextAction is only valid to use when the EmailTo parameter is set. e.g. #_ NextAction 4 _# |
The following parameter causes pdfMachine to automatically save the resultant PDF file to the specified location.
Parameter | Description |
---|---|
SavePdf | Argument: Path to the location to save the PDF file
e.g. #_ SavePdf C:\savedFileHere.pdf _# |
The following parameters insert or append files into the resultant PDF file .
Parameter | Description |
---|---|
AppendPdf | Argument: Path to the PDF file that is to be appended.
e.g. #_ AppendPDF c:\somefile.pdf _# Multiple appendPdf parameters can appear in the file which will result in multiple PDF's being appended. |
InsertPdf | Argument: Page number after which to insert ( 0 to insert at the start of file), path to the PDF file to insert. |
The following parameters cause pdfMachine to enable encryption and to set the appropriate passwords in the resultant PDF file.
Parameter | Description |
---|---|
OpenPass | Argument: Password required to open the document
(a.k.a. user password). e.g. #_ OpenPass mysecret _# NOTE : Set the other encryption parameters in the pdfMachine options screens. |
PermPass | Argument: Permissions password (a.k.a. owner
password). e.g. #_ PermPass mysecret _# NOTE : Set the other encryption parameters in the pdfMachine options screens. |
The following parameter overrides the current pdfMachine stationery settings. There are two settings, one for all pages and one for first page only. If you want to completely control the stationery in parameter parsing then you should specifically set both of them.
Parameter | Description | ||||||
---|---|---|---|---|---|---|---|
Stationery | Arguments: pages drawn path
e.g. Set the stationery for 'all pages' to be c:\stationery.pdf and draw it on top of the page text. Any 'first page only' stationery will still be used. #_ Stationery all above c:\stationery.pdf _# e.g. Set the stationery for 'all pages' to be c:\stationery.pdf and draw it on top of the page text. Turn off any 'first page only' stationery that has been defined. #_ Stationery all above c:\stationery.pdf _# #_ Stationery first none _# e.g. Turn off all stationery. #_ Stationery none _# |
The following parameter causes pdfMachine to Inserts the selected digital signature at the current place in the file.
Parameter | Description | ||||
---|---|---|---|---|---|
DigSig | Argument: visible enabled
e.g. #_ DigSig noshow _# NOTE : the DigSig parameter *must* be followed by at least one other piece of text so that the regular expression can find it. Anything other that the parameters shown above are ignored, so it is fine to just put something simple like '1'. e.g. #_ DigSig 1 _# NOTE : Set up the other signature details in the pdfMachine options. |
The following parameter causes pdfMachine to attach file(s) to the resultant PDF file. The attached files can be seen in the attached files list in Acrobat Reader 6 and 7.
Parameter | Description |
---|---|
embed | Argument: Path of the file to be embedded. e.g. #_ embed C:\afile.pdf _# #_ embed C:\somefile.pdf _# Call embed multiple times to embed multiple files. |
The following parameter causes pdfMachine to insert images into the resultant PDF file.
Parameter | Description | ||||||
---|---|---|---|---|---|---|---|
InsertImage | Arguments: width height path e.g. #_ InsertImage 100 100 C:\somefile.jpg _#
Note: 1 point = 1/72th inch InsertImage can be called more than once per page. |
Parameter | Description |
---|---|
SplitPDF | Argument: dummy argument to help regular expression parsing
e.g. #_ SplitPDF 1 _# Note the SplitPDF parameter must be followed by some other text, which is '1' in this case. Splits document at the end of the current page. This should be used with extreme caution, as it may result in multiple emails being sent for a single print job. Please be sure you do adequate testing to ensure the emails are as you wish. Make sure that there is no more that one SplitPDF command on a single page. This can be useful for integrating with a legacy application, or Crystal Reports solution that creates one big print job with each customer statement on a new page. e.g. An accounting application may print out a number customer invoices, one after the other in one big print job. Normally this would generated 1 large PDF. However, using a combination of "SplitPDF" and "email" parameters each customer would be emailed a unique invoice belonging to them. |
Parameter | Description |
---|---|
bm | Argument: bookmark name\sub bookmark name A back slash separated list of heading names, forming a table of contents or bookmark hierarchy. Bookmarks provide a table of contents and usually represent the chapters and sections in a document. Bookmarks appear in the navigation pane of adobe reader. When a bookmark is clicked, the reader will be presented with the section where the "bm" command was placed. e.g #_ bm This is a top level bookmark _# #_ bm This is a top level bookmark\sub section 1 _# #_ bm This is a top level bookmark\sub section 2\more news _# Produces PDF with a bookmarks window in Adobe Reader: ![]() |
Parameter | Description |
---|---|
Argument: printer name Used to print to a secondary printer. This could be useful if a hardcopy is desired as well as the PDF. If the word "default" is used for the printer name the default printer is used. e.g 1 - Print to a specific printer name #_ print HP Office Jet v49 _# e.g 2 - Print to the default printer #_ print default _# | |
Parameter | Description |
---|---|
l | Argument: link_text URL A hyperlink is created pointing to URL. The text 'link_text' will remain. e.g #_ l link to broadgun http://www.broadgun.com _# #_ l hi there http://www.google.com _# |
The 'i' parameter defines the position of the image that will be inserted into the PDF by the 'ii' command.
Parameter | Description |
---|---|
i |
Argument: tag
A tag name that is used by the ii, il and ilqs commands. e.g #_ i 1 _# Add a Paypal 'pay now' button to your PDFUsing pdfMachine parameter parsing you can now create 'pay now' or
'buy now' buttons that appear on your PDF. When the button is clicked a
browser is launched displaying a PayPal webpage where the transaction can
be compeleted.
Any image can be made into a clickable button that launches a customizable URL.Using pdfMachine parameter parsing, images with hyperlinks can be dynamically built.
|
Inserts an image into the PDF. The image is inserted at the location defined by the 'i' command.
Parameter | Description |
---|---|
ii |
Arguments: tag width URL
tag - An alphanumeric string that refers to the image location previously defined by the 'i' command. width - Optional. The width of the image in points. URL - Can be a http or https URL or a file path on the local PC. File types supported are: gif, png, jpg, bmp. e.g.1 #_ ii 1 100 http://www.broadgun.com/somepic.png _# e.g.2 #_ ii 2 c:\tmp\somepic.jpg _# Add a Paypal 'pay now' button to your PDFUsing pdfMachine parameter parsing you can now create 'pay now' or
'buy now' buttons that appear on your PDF. When the button is clicked a
browser is launched displaying a PayPal webpage where the transaction can
be compeleted.
Any image can be made into a clickable button that launches a customizable URL.Using pdfMachine parameter parsing, images with hyperlinks can be dynamically built.
|
Inserts a hyperlink into the PDF. The position and size is defined previously by the 'i' and 'ii' commands.
Parameter | Description |
---|---|
Arguments: tag URL
tag - An alphanumeric string that refers to the image location previously defined by the 'i' command. URL - Can be a http or https URL. e.g. #_ il http://www.broadgun.com _# Add a Paypal 'pay now' button to your PDFUsing pdfMachine parameter parsing you can now create 'pay now' or
'buy now' buttons that appear on your PDF. When the button is clicked a
browser is launched displaying a PayPal webpage where the transaction can
be compeleted.
Any image can be made into a clickable button that launches a customizable URL.Using pdfMachine parameter parsing, images with hyperlinks can be dynamically built.
| |
Used to build a query string for a URL. The base of the URL is defined by the 'il' command. Several 'ilqs' commands can appear all relating to the same URL.
Parameter | Description |
---|---|
l |
Arguments: tag name value
tag - An alphanumeric string that refers to the image location previously defined by the 'i' command. name - Parameter name. This will be URL parameter encoded. value - Parameter value. This will be URL parameter encoded. Add a Paypal 'pay now' button to your PDFUsing pdfMachine parameter parsing you can now create 'pay now' or
'buy now' buttons that appear on your PDF. When the button is clicked a
browser is launched displaying a PayPal webpage where the transaction can
be compeleted.
Any image can be made into a clickable button that launches a customizable URL.Using pdfMachine parameter parsing, images with hyperlinks can be dynamically built.
|
Parameter | Description |
---|---|
x_embed | Arguments: basic | path_to_xml_file This defines what XML is used as a template file to embed into the PDF. If the word "basic" is used, the template is the one that is edited by the ZUGFeRD template form. Otherwise a full path to another file can be used. |
Parameter | Description |
---|---|
x | Argument: XML_tag_name This is how XML elements are set. The XML_tag_name must be unique in the XML file defined by the x_embed command. e.g. If the XML defined by the x_embed entry was : <sometag> <apples> <style></style> <quality> <type></type> </quality> </apples> <oranges> <quality> <type></type> </quality> </oranges> </sometag>The parameters: #_ x style pink lady _# #_ x apples/quality/type fresh _# #_ x oranges/quality/type old _# Would result in the following XML being embedded into the PDF: <sometag> <apples> <style>pink lady</style> <quality> <type>fresh</type> </quality> </apples> <oranges> <quality> <type>old</type> </quality> </oranges> </sometag> Note that the 'type' tag was defined in multiple places, so we needed to be more specific and include the parent tag names. For the tag 'style', it was only in one place so there was no need to include the parent tag names. |
Parameter | Description |
---|---|
x_clone | Argument: XML_tag_name This command copies the last occurring XML tag (and children) in the XML and appends it as a sibling to the XML tag. Its a mechanism for including creating collections in the XML. |
Print the following text to pdfMachine to send an email to user@broadgun.com,
with the attachment called "mypdf.pdf" and the subject "pdfMachine is great" and
the body "Hi, Please have a look at the attachment." (spread over 2 lines).
#_ email user@broadgun.com _# #_ emailsubject pdfMachine is great _# #_ EmailAttachmentName mypdf.pdf _# #_ Emailbody Hi, Please have a look at the attachment. _# This is the attachment text, it will appear in the PDF. |
Print the following text to pdfMachine to launch the default email client
without actually sending the email.
#_ emailTo user@broadgun.com _# #_ NextAction 4 _# #_ emailsubject pdfMachine is great _# #_ EmailAttachmentName mypdf.pdf _# #_ Emailbody Hi, Please have a look at the attachment. _# This is the attachment text, it will appear in the PDF. |
You can either:
Set the pdfMachine options to have the email configuration as below:
Then print the following text to pdfMachine to send an email to john@yourserver.com, with the attachment called "subscription.pdf" and the subject "Subscription expires on 1st March 2006" and the body "Dear John Your subscription to our magazine will expire on 1st March 2006" (spread over 2 lines).
#_ email john@yourserver.com _# #_ EmailAttachmentName subscription.pdf _#
|
Or you can do the whole thing using parameter parsing. You do not need to setup the Email Configuration in the options. You can print the following text to pdfMachine to send an email to john@yourserver.com, with the attachment called "subscription.pdf" and the subject "Subscription expires on 1st March 2006" and the body "Dear John Your subscription to our magazine will expire on 1st March 2006" (spread over 2 lines).
#_ email john@yourserver.com _# #_ EmailAttachmentName subscription.pdf _#
Your subscription to our magazine will expire on {expiry_date}. _# #_ Mergefield first_name John _# |
Print the following text to pdfMachine to append the contents of the file 'one.PDF' and 'two.pdf' into the resultant PDF.
#_ appendPdf c:\one.pdf _# #_ appendPdf c:\two.pdf _# Put any text here , this forms the main pdf. |
Print the following text to pdfMachine to append the contents of the file otherPDF.PDF into the resultant PDF at the start of the file.
#_ insertPDF 0 My Documents\otherPDF.pdf _#
Put any text here - this will appear after the contents of the file otherPDF.pdf |
Print the following text to pdfMachine to embed files in the resultant PDF.
#_ embed c:\somefile.txt _# #_ embed c:\anotherfile.txt _# Put any text here - this will appear as the contents of the PDF file. The PDF file will have an "attachments" window containing the two text files. |
Print the following text to pdfMachine to send two emails.
#_ email john@yourserver.com _# Customer Name: John .. (make sure there is a page break before this next text) #_ email dave@yourserver.com _# Customer Name: Dave |
ZUGFeRD is a German e-invoicing standard. A ZUGFeRD PDF is a PDF/3-A
compliant PDF file that is a visual invoice, just like any other. It also
contains structured invoice data in an embedded XML document that can be
processed by ZUGFeRD compliant applications. For details, please go to www.ferd-net.de
What follows is an
example set of parameters that will produce a ZUGFeRD XML when printed to
pdfMachine. The XML tag names are all taken from the ZUGFeRD specification.
Note:
No validation is performed on the XML, so its up to you to make sure the field
values are valid.
#_ x_embed basic _# // embed basic ZUGFeRD profile // invoice id and dates #_ x rsm:HeaderExchangedDocument/ram:ID 2323 _# // unique invoice ID #_ x ram:IssueDateTime/udt:DateTimeString 20140711 _# #_ x ram:OccurrenceDateTime/udt:DateTimeString 20140711 _# // set the totals #_ x ram:LineTotalAmount 845.00 _# #_ x ram:ChargeTotalAmount 0 _# #_ x ram:AllowanceTotalAmount 0 _# #_ x ram:TaxBasisTotalAmount 845.00 _# #_ x ram:TaxTotalAmount 160.55 _# #_ x ram:GrandTotalAmount 1005.55 _# #_ x ram:DuePayableAmount 1005.55 _# // line items #_ x ram:LineID 1 _# #_ x ram:BilledQuantity 1 _# #_ x ram:LineTotalAmount 800 _# #_ x ram:SpecifiedTradeProduct/ram:Name Pink Hammers _# #_ x_clone ram:IncludedSupplyChainTradeLineItem _# // copy previous line item #_ x ram:LineID 2 _# #_ x ram:BilledQuantity 1 _# #_ x ram:LineTotalAmount 100 _# #_ x ram:SpecifiedTradeProduct/ram:Name Blue Nails _# #_ x_clone ram:IncludedSupplyChainTradeLineItem _# // copy previous line item #_ x ram:LineID 3 _# #_ x ram:BilledQuantity 2 _# #_ x ram:LineTotalAmount 105.55 _# #_ x ram:SpecifiedTradeProduct/ram:Name Green Widgets _#