Programming Interface:
The programming interface offers a simple set of APIs. You can perform the conversion using as little
as 3 API functions.
This product is available for the following platforms:
Feature list:
● Full character and paragraph formatting
● Advanced table and nested table support, including vertical text and right-to-left columns
● Text boxes, shapes, positioned images, and frames with vertical text options
● Flexible headers/footers for first, left, right, or both pages
● Page footnotes and section endnotes
● Multiple sections per document with custom columns, page sizes, orientations, and margins
● Embedded and linked graphics
● Complex lists and overrides
● Unicode: Arabic, Hebrew, Asian, Indic, and more; mixed LTR/RTL text
● Embedded fonts, bookmarks, references, and TOC
● Track changes and margin comments (vertical/horizontal)
● Internal and external hyperlinks, hidden text
● Rich-text fields including page numbers, counts, dates
● Checkboxes, radio buttons, list boxes, and dropdowns
● Document embedding in PDF and compliance with common PDF standards
● Security permissions and password protection
Contact us if a needed feature isn't listed–it's likely supported.
" I appreciate your help and attention to my problems..
This is probably why I have used your Tern control since 2000! "
Eric Gilbert
Black, Mann & Graham, L.L.P.
" We considered a few different options when looking into getting a text control package and ended up going with yours. We could not be happier with our decision. The impressive functionality of your control and the rich API support is really not available elsewhere. We have also been very impressed with your support. We had to go with another company for a component you don't offer and though their website was more flashy, they have consistently let us down. You on the other hand have always been responsive and professional with answering any questions or releasing any fixes. Based on experience, I don't know why anyone would ever choose one of your competitors over you! "
Carl Christensen
Software Developer ,Western Standard
RTF to PDF Converter for .NET C#/WinForm/ASP.NET, 32/64 Bit (ZIP FILE)
RTF to PDF Converter for .NET Core for Windows and Linux (ZIP FILE)
RTF to PDF Converter for Win32 DLL/ActiveX/MFC/C/C++/ASP (ZIP FILE)
RTF to PDF Converter for Win64 C/C++/MFC SDK (ZIP FILE)
RTF to PDF Converter for .NET C#/WinForm/ASP.NET, 32/64 Bit (PDF FILE)
RTF to PDF Converter for .NET Core for Windows and Linux (PDF FILE)
RTF to PDF Converter for Win32 DLL/ActiveX/MFC/C/C++/ASP (PDF FILE)
RTF to PDF Converter for Win64 C/C++/MFC SDK (PDF FILE)
Since our components are targeted toward software developers, the installation is simple. Our component software is delivered in a zip file. To install, simply copy the content of the zip folder to an empty folder in your computer and then follow the instruction for the product usage.
Our software does not install itself, so you can be rest assured that your system is not affected by an automatic installation process.
Please click here to view the license agreement for the product. The license agreements for the other products are found on their respective page.
To Uninstall, simply delete all product files from the installation folder or any other folder where you might have copied the product files. For example, if you copied the content of the installation zip folder to a folder called c:\MyFolder, then select the contents of the MyFolder folder, and delete all files. If you have copied the DLLs to your project folder, then delete those DLL files as well.
Please Click Here to read about our Technical Support options.
|
|
RTF to PDF Converter for .NET Core – Windows / Linux
and
RTF to PDF Converter for .NET Framework
|
|
|
|
Getting Started
|
|
This chapter describes the contents of the software distribution ZIP file, and provides a
step by step process of incorporating the converter functionality into your application. To
begin:
1. Add the reference for rpn.dll in your project.
Net Core: For the .NET core product, create a project reference for the included product
package. The package name is found as rpi.20.n.n.n.nupkg. The 'n.n.n' stands for the
product minor release number. This is how your project file would apear:
<PackageReference Include="rpi" Version="20.0.0.0"/>
Also, add the 'using' or 'Import' namespace statement for the project dll, example:
using SubSystems.RP
or
Import SubSystems.RP
|
|
|
|
License Key
|
|
|
|
|
|
|
|
Your License Key and License number are e-mailed to you after your order is processed.
You would set the license information using the RpsSetLicenseInfo static function. This
should be preferably done before creating the Rpn object to avoid pop-up nag screens.
int RpsSetLicnseInfo(String LicenseKey, String LicenseNumber, String CompanyName);
| |||
|
|
LicenseKey:
|
Your license key is available in the product delivery email sent to
you upon the purchase of the product. It consists of a string in the
form of "xxxxx-yyyyy-zzzzz".
|
| |
|
|
LicenseNumber:
|
Your license number is also available in the product delivery email.
The license number string starts with a "srab" or "smo" prefix.
|
| |
|
|
CompanyName:
|
Your company name as specified in your order.
|
| |
|
|
Return Value: This method returns 0 when successful. A non-zero return value indicates
an error condition. Here are the possible return values:
| |||
|
|
0
|
License application successful.
|
| |
|
|
1
|
Invalid License Key.
|
| |
|
|
2
|
Invalid License Number.
|
| |
|
|
3
|
Ran out of available licenses. Please consider purchasing additional licenses.
|
| |
|
|
Example:
result=Rpn.RpsSetLicenseInfo("xxxxx-yyyyy-zzzzz","srabnnnnn-n","Your Company
Name")
Replace the 'xxxxx-yyyyy-zzzzz' by your license key, replace "srabnnnnn-n" with your
license number, and "Your Company Name" with your company name as specified in
your order.
| |||
|
|
Note: RpsSetLicenseInfo method should be called only once at the beginning of your
application. Calling this method for each conversion would degrade the conversion
performance.
| |||
Sample Conversion Code
|
|
.NET Core: Include the rpi.20.n.n.n.nupkg nuget package in your project. This is how
your project file entry would appear:
<PackageReference Include="rpi" Version="20.0.0.0"/>
This package is included in the distribution zip folder.
.NET Framework: Please ensure that RPN.DLL, TESN31.DLL, and PDN18.DLL files are
available in the project directory. Set the reference for RPN.DLL in your project. The
TESN32.DLL and PDN19.DLL are referenced indirectly by RPN.DLL.
Now set the namespace for the product:
using SubSystems.RP; // C# example
Imports SubSystems.RP ' VB Example
Now set the product license key and create an RPN type object:
Rpn.RpsSetLicenseInfo("xxxxx-yyyyy-zzzzz","srabnnnnn-n","My company name")
Rpn rp = new Rpn() // C# example
dim rp as Rpn ' VB example
rp.InWebServer = true; // set to true when hosting the
// converter in an ASP.NET app
Now use one of the following calls to convert from RTF to PDF formats:
1. Convert an RTF file to a PDF file.
rp.RpsConvertFile("test.rtf","test.pdf")
2. Convert an RTF string to a PDF string
Dim PdfString as string
PdfString= rp.RpsConvertBuffer(RtfString)
|
|
|
|
Control Methods
|
|
These methods allow you to convert from rtf to pdf format. Please set the namespace for
the Rpn class before using these methods:
using SubSystems.RP; // C# example
Imports SubSystems.RP ' VB Example
|
|
|
|
RpsConvertBuffer
|
|
|
|
|
|
Convert rtf to pdf using text string.
String RpsConvertBuffer(InString)
| |
|
|
String InString;
|
// Input string containing RTF formatted document.
|
|
|
Return value: This function returns a string containing the converted documented.
This pdf string can be written to a disk file by using the RpsWriteToFile method.
Also, you can extract the byte array from this string by using the RpsStrToBytes method.
A null return values indicates an error.
Examples:
Convert an RTF string to a PDF string
Dim PdfString as string
PdfString= rp.RpsConvertBuffer(RtfString)
| |
RpsConvertFile
|
|
|
|
|
|
|
Convert rtf to pdf using disk files.
bool RpsConvertFile(InFile, OutFile)
| ||
|
|
string InFile;
|
// Input file containing RTF document
|
|
|
|
string OutFile;
|
// Output files, contains the converted document
|
|
|
|
Return value: This function returns TRUE when successful.
Examples:
Convert an RTF file to a PDF file.
rp.RpsConvertFile("test.rtf","test.pdf")
| ||
RpsGetLastMessage
|
|
|
|
|
|
Get the last message.
int RpsGetLastMessage(RpsMessage, DebugMessage);
| |
|
|
string RpsMessage;
|
// Returns the default user message text in English
|
|
|
string DebugMsg;
|
// Returns any debug message associated with the last
message. The debug message need not be displayed to
the user.
|
|
|
Return Value: This function returns the last message generated by the editor. This value
is valid only if saving of the messages is enabled by setting the
RPFLAG_RETURN_MSG_ID flag. This flag is set using the RpsSetFlags method.
| |
RpsResetLastMessage
|
|
Reset the last editor message.
bool RpsResetLastMessage()
|
|
|
Description: This function can be called before calling any other function to reset the
last error message.
Return Value: The function returns TRUE when successful.
|
|
See Also
|
RpsSetFlags
|
|
|
|
|
|
|
|
Set certain flags or retrieve the values of the flags.
int RpsSetFlags(set, flags)
| |||
|
|
bool set;
|
// TRUE to set the given flags, FALSE to reset the given
flags
| ||
|
|
int flags;
|
// Flags (bits) to set or reset. Currently, the following flag
values are available:
| ||
|
|
|
RPFLAG_RETURN_MSG_ID
|
Do not display the error messages. Save
the error code to be later retrieved using
the RpsGetLastMessage function.
| |
|
|
|
|
| |
|
|
Return value: This function returns the new value of all the flags. Call this function with
the 'flags' parameter set to zero to retrieve flag values without modifying it.
| |||
RpsStrToBytes
|
|
|
|
|
|
Convert a pdf string to a byte array.
byte[] RpsStrToBytes(PdfString)
| |
|
|
String PdfString;
|
// Input string containing PDF text.
|
|
|
Return value: This function returns a byte array from the given string. This is a preferred
method of converting a pdf string to a byte array because it returns the raw bytes without
employing an encoding method.
A null return values indicates an error.
| |
|
|
Example:
Response.Clear();
Response.Charset = "";
Response.ContentType = "application/pdf";
string strFileName = "test" + ".pdf";
Response.AddHeader("Content-Disposition",
"inline;filename=" + strFileName);
Rpn rp = new Rpn();
rp.InWebServer=true;
String pdfString = rp.RpsConvertBuffer(RtfText);
Response.BinaryWrite(rp.RpsStrToBytes(pdfString));
Response.Flush();
Response.Close();
Response.End();
| |
RpsWriteToFile
|
|
|
|
|
|
|
Write a pdf string to a disk file.
bool RpsWriteToFile(FileName, PdfString)
| ||
|
|
string FileName;
|
// Output file.
|
|
|
|
string PdfString;
|
// Pdf string to be written to the disk file
|
|
|
|
Return value: This function returns TRUE when successful.
| ||
Control Properties
|
|
|
|
|
|
|
|
|
|
|
The control properties can be before the conversion to affect the pdf output. The control
supports the following properties:
| ||||||
|
|
| ||||||
|
|
InWebServer
| ||||||
|
|
|
This property should be set to True when this control is used in a web server.
When this property is set to True, the control suppress the display of any dialog
and message boxes.
|
| ||||
|
|
| ||||||
|
|
Author
| ||||||
|
|
|
Set the author name for the PDF document.
|
| ||||
|
|
| ||||||
|
|
Bookmark
| ||||||
|
|
|
Set to true to convert the rtf table-of-content to PDF bookmark. The default value
is true.
|
| ||||
|
|
| ||||||
|
|
CreDate
| ||||||
|
|
|
Set the document creation date. The date is specified in a text string.
|
| ||||
|
|
| ||||||
|
|
FontFolder .NET Core specific
| ||||||
|
|
|
Specify the path to the folder from where to load additional True Type fonts. This
property allows you make available additonal fonts for your application
|
| ||||
|
|
| ||||||
|
|
Hyperlink
| ||
|
|
|
Set to true to translate rtf hyperlink fields to pdf hyperlinks. The default value is
true.
|
|
|
|
| ||
|
|
InWinOS .NET Core specific
| ||
|
|
|
Set to true if your application will be running on a server with full windows
environment such as physical or virutual Windows server.
|
|
|
|
| ||
|
|
Keywords
| ||||||||
|
|
|
Set the keywords for the PDF document.
|
| ||||||
|
|
| ||||||||
|
|
LicenseKey
| ||||||||
|
|
|
Set the product license key for the product. Your license key is e-mailed to you after
your order is processed.
|
| ||||||
|
|
| ||||||||
|
|
ModDate
| ||||||||
|
|
|
Set the document modification date. The date is specified in a text string.
|
| ||||||
|
|
| ||||||||
|
|
Producer
| ||||||||
|
|
|
Set the producer description for the PDF document.
|
| ||||||
|
|
| ||||||||
|
|
Subject
| ||||||||
|
|
|
Set the subject description for the PDF document.
|
| ||||||
|
|
| ||||||||
|
|
Title
| ||||||||
|
|
|
Set the title for the PDF document
|
| ||||||
|
|
| ||||||||
|
|
CompressText
| ||||||||
|
|
|
Set to true to compress the text stream in the PDF output.
|
| ||||||
|
|
| ||||||||
|
|
PermFlags
| ||||||||
|
|
|
Use this flag to specify the permissions granted when the PDF document is being
viewed or manipulated. You can use one or more of the following flags using the OR
operator:
|
| ||||||
|
|
|
pc.PERM_PRINT
|
Allow printing
operation
|
|
| ||||
|
|
|
pc.PERM_COPY
|
Allow copying
operation
|
|
| ||||
|
|
|
pc.PERM_MOD
|
Allow document
modification
|
|
| ||||
|
|
|
The OwnerPassword property must also be set for the PDF reader to honor the
permission flags.
|
| ||||||
|
|
| ||||||||
|
|
OwnerPassword
| ||||||||
|
|
|
Optional document owner password.
When either an owner or a user password is specified, the PDF document is written
out using Adobe standard encryption mechanism.
An owner password in the PDF document requires a PDF editor to prompt the user for
the owner password and allow PDF modification only when the supplied owner
password matches the encrypted owner password found in the file.
|
| ||||||
|
|
| ||||||||
|
|
UserPassword
| ||||||||
|
|
|
Optional user password
When either an owner or a user password is specified, the PDF
document is written out using Adobe standard encryption
mechanism.
A user password in the PDF document requires a PDF viewer to
prompt the user for the user password and allow PDF display only
when the supplied user password matches the encrypted user
password (or owner password) found in the file.
|
| ||||||
|
|
EmbedFonts
| ||||||||
|
|
|
Normally the converter only embeds non-standard fonts in the PDF
file. This flag would instruct the converter to embed all fonts.
|
| ||||||
|
|
| ||||||||
|
|
ExactTextPlacement
| ||||||||
|
|
|
Set to True to instruct the converter to emit
character width for every character thus providing
for precise text layout. This option is useful when
converting a file containing small fonts.
|
| ||||||
|
|
| ||||||||
|
|
RC4_128
| ||||||||
|
|
|
Set to true to enable RC4 128 bit security when a
password is specified.
|
| ||||||
|
|
| ||||||||
|
|
AES_128
| ||||||||
|
|
|
Set to true to enable AES 128 bit security when a
password is specified.
|
| ||||||
|
|
| ||||||||
|
|
PdfA
| ||||||||
|
|
|
Set to true to generate PDF-A compliant
document.
|
| ||||||
|
|
| ||||||||
|
|
PdfA1b
| ||||||||
|
|
|
Set to true to generate PDF-A/1b compliant
document
|
| ||||||
|
|
| ||||||||
|
|
PdfUA
| ||||||||
|
|
|
Set to true to generate PDF-UA (User Accessibility) compliant
document
|
| ||||||
|
|
| ||||||||
|
|
ShrinkImagesToFit
| ||||||||
|
|
|
Shrink the RTF images to fit on the page or the table cell.
|
| ||||||
|
|
| ||||||||
|
|
NoTocUpdate
| ||||||||
|
|
|
Do not update original table-of-content before
generating pdf.
|
| ||||||
|
|
| ||||||||
|
|
PropPictQuality
| ||||||||
|
|
|
Specify picture quality from 1 to 5, where
1=lowest, 5=highest, 3=default
|
| ||||||
|
|
| ||||||||
|
|
Time24Hours .NET Core Specific
| ||||||||
|
|
|
Set this property to True if you wish any TIME field
data embedded in your document to be formatted
using the 24 hour format.
|
| ||||||
|
|
| ||||||||
|
|
UseSfnDllFonts .NET Core Specific
| ||
|
|
|
This property is set to True by default which allows
the converter to user the built-in fonts. You can
set this properlty to False if you do not want the
converter to user the built-in fonts.
|
|
|
|
| ||
|
|
UseOrigJpg
| ||
|
|
|
Insert the original jpeg image data into the pdf file.
|
|
|
|
| ||
|
|
UseWindowsFonts .NET Core Specific
| ||
|
|
|
Set this property to true if your application is
running on a Windows physical or virtual server,
and you would like to user windows True Type
fonts available in Windows folder.
|
|
|
|
| ||
|
|
RTF to PDF Converter
For Win32/Win64
|
|
|
|
License Key
|
|
|
|
|
|
|
|
Your License Key and License number are e-mailed to you after your order is processed.
You would set the license information using the RpsSetLicenseInfo static function. This
should be preferably done before creating the converter session to avoid pop-up nag
screens.
int RpsSetLicenseInfo(LPBYTE LicenseKey, LPBYTE LicenseNumber, LPBYTE
CompanyName);
| |||
|
|
LicenseKey:
|
Your license key is available in the product delivery email sent to
you upon the purchase of the product. It consists of a string in the
form of "xxxxx-yyyyy-zzzzz".
|
| |
|
|
LicenseNumber:
|
Your license number is also available in the product delivery email.
The license number string starts with a "srab" or "smo" prefix.
|
| |
|
|
CompanyName:
|
Your company name as specified in your order.
|
| |
|
|
Return Value: This method returns 0 when successful. A non-zero return value indicates
an error condition. Here are the possible return values:
| |||
|
|
0
|
License application successful.
|
| |
|
|
1
|
Invalid License Key.
|
| |
|
|
2
|
Invalid License Number.
|
| |
|
|
3
|
Ran out of available licenses. Please consider purchasing additional licenses.
|
| |
|
|
Example:
result=RpsSetLicenseInfo("xxxxx-yyyyy-zzzzz","srabnnnnn-n","Your Company Name")
Replace the 'xxxxx-yyyyy-zzzzz' by your license key, replace "srabnnnnn-n" with your
license number, and "Your Company Name" with your company name as specified in
your order.
| |||
|
|
Note: RpsSetLicenseInfo method should be called only once at the beginning of your
application. Calling this method for each conversion would degrade the conversion
performance.
Also, you can use the RpsGetLicenseStatus function at anytime to retrieve the license
status.
| |||
Incorporating the DLL into Your Application
|
|
A C/C++ application should include the RPS.h file into the application module that needs
to call the RPS32 dll. It also should include the RPS32.LIB as the linker library. Please
refer to the demo application for an example.
A Visual Basic application needs to include the RPS.BAS file in the project. Please refer
to the DMO_VB project for an example.
If you using Clarion, please ask us for a demo written in Clarion provided by one of our
customers.
Please also make sure that the rps32.dll and other DLLs from the distribution zip file are
copied to a directory available at run-time.
|
|
|
|
.
Sample Conversion Code
|
|
First you would create a new conversion session:
dim id as long
result=RpsSetLicenseInfo("xxxxx-yyyyy-zzzzz","srabnnnnn-n","Your Company Name")
id = RpsNewSession()
You would use the session id to call other conversion functions.
Here are sample code examples to convert RTF to PDF format.
1. Convert an RTF file to an PDF file.
RpsConvertFile(id,"test.rtf","test.pdf")
2. Convert an RTF string to an PDF string
Dim hMem as long
Dim OutSize as long
Dim RtfString as string
hMem = RpsConvertBuffer(id,RtfString, Len(RtfString),
OutSize)
If (hMem <> 0) Then
PdfString = Space$(OutSize + 1) ' allocate space for the
output string
RpsHandleToStr(PdfString, OutSize, hMem) ' copy pdf from
hMem global handle to the PdfString variable.
End If
After the conversion process, end the session by calling the RpsEndSession function.
This frees up the memory used by the session.
RpsEndSession(id)
|
|
|
|
Application Interface functions
|
|
These API functions allow you to convert from rtf to pdf format. Your application must
include the RPS.H file (c/c++), or RPS.BAS (VB) files. These files declare these
functions.
The following is a description of the Rps API functions in an alphabetic order:
|
|
|
|
RpsConvertBuffer
|
|
|
|
|
|
Convert rtf to pdf using memory buffers.
HGLOBAL RpsConvertBuffer(id, InString, InStringLen, OutStringLen)
| |
|
|
DWORD id;
|
Session id.
|
|
|
LPBYTE InString;
|
Input string containing RTF document.
|
|
|
int InStringLen;
|
length of the input document string.
|
|
|
LPINT OutStringLen;
|
The variable to receive the length of the converted
document.
|
|
|
Return value: This function returns a global memory handle containing the converted
documented. You can either use the RpsHandleToStr or GlobalLock functions to access
the data string contained in this global memory handle. GlobalLock is a Windows SDK
function.
A null return values indicates an error.
Examples:
Dim hMem as long
Dim OutSize as long
Dim RtfString as string
hMem = RpsConvertBuffer(id,RtfString, Len(RtfString),
OutSize)
If (hMem <> 0) Then
PdfString = Space$(OutSize + 1) ' allocate space for the
output string
RpsHandleToStr(PdfString, OutSize, hMem) ' copy pdf from
hMem global handle to the PdfString variable.
End If
| |
RpsConvertFile
|
|
|
|
|
|
|
Convert rtf to pdf using disk files.
BOOL RpsConvertFile(id, InFile, OutFile)
| ||
|
|
DWORD id;
|
Session id.
|
|
|
|
LPBYTE InFile;
|
Input file containing RTF document
|
|
|
|
LPBYTE OutFile;
|
Output files, contains the converted document
|
|
|
|
Return value: This function returns TRUE when successful.
Examples:
RpsConvertFile(id,"test.rtf","test.pdf")
| ||
RpsEndSession
|
|
|
|
|
|
End a conversion session.
BOOL RpsEndSession(id)
| |
|
|
DWORD id;
|
Session id.
|
|
|
Description: This function is called at the end of the conversion process to free up the
session related resources.
Return Value: The function returns TRUE when successful.
| |
RpsGetLastMessage
|
|
|
|
|
|
Get the last message.
int RpsGetLastMessage(id, RpsMessage, DebugMessage);
| |
|
|
DWORD id;
|
Session id.
|
|
|
LPBYTE RpsMessage;
|
Returns the default user message text in English
|
|
|
LPBYTE DebugMsg;
|
Returns any debug message associated with the last
message. The debug message need not be displayed to
the user.
|
|
|
Return Value: This function returns the last message generated by the editor. This value
is valid only if saving of the messages is enabled by setting the
HRFLAG_RETURN_MSG_ID flag. This flag is set using the RpsSetFlags function.
| |
RpsGetLicnseStatus
|
|
|
|
|
|
|
Get the license status.
int RpsGetLicenseStatus()
| ||
|
|
Return Value:
| ||
|
|
0
|
License application successful.
|
|
|
|
1
|
Invalid License Key.
|
|
|
|
2
|
Invalid License Number.
|
|
|
|
3
|
Ran out of available licenses. Please consider purchasing additional licenses.
|
|
|
|
4
|
The evaluation period has expired.
|
|
|
|
You can use the RpsGetLicenseStatus function at anytime to retrieve the license status.
| ||
RpsHandleToStr
|
|
|
|
|
|
Convert a global memory handle to a Visual Basic string.
BOOL RpsHandleToStr(string, length, hMem)
| |
|
|
LPBYTE string;
|
pointer to a visual basic string
|
|
|
long length
|
length of the string
|
|
|
HGLOBAL hMem;
|
Global memory handle
|
|
|
Description: This function can be used to copy the contents of a global memory handle
to a given visual basic string. The calling routine must expand the string to appropriate
length before calling this function.
Example:
string=space(length)
HandleToStr(string,length,hMem)
The input global memory handle is freed up after copying its contents to the string.
Return Value: This function returns TRUE if successful.
| |
RpsNewSession
|
|
Create a new conversion session.
DWORD RpsNewSession()
|
|
|
Description: This function needs to be called before calling any other conversion
function. This function creates a new conversion session.
The RpsEndSession must be called at the end to free up the session resources. All other
conversion functions are called between the calls to the RpsNewSession and
RpsEndSession functions.
Return Value: The function returns a non-zero session-id when successful. A zero value
indicates a fail return.
|
RpsResetLastMessage
|
|
|
|
|
|
Reset the last editor message.
BOOL RpsResetLastMessage(id)
| |
|
|
DWORD id;
|
Session id.
|
|
|
Description: This function can be called before calling any other function to reset the
last error message.
Return Value: The function returns TRUE when successful.
| |
|
See Also
|
RpsSetFlags
|
|
|
|
|
|
|
|
Set certain flags or retrieve the values of the flags.
DWORD RpsSetFlags(id, set, flags)
| |||
|
|
DWORD id;
|
Session id.
| ||
|
|
BOOL set;
|
TRUE to set the given flags, FALSE to reset the given
flags
| ||
|
|
DWORD flags;
|
Flags (bits) to set or reset. Currently, the following flag
values are available:
| ||
|
|
|
RPFLAG_RETURN_MSG_ID
|
Do not display the error messages. Save
the error code to be later retrieved using
the RpsGetLastMessage function.
| |
|
|
Return value: This function returns the new value of all the flags. Call this function with
the 'flags' parameter set to zero to retrieve flag values without modifying it.
| |||
RpsSetBoolProp
|
|
|
|
|
|
|
|
Set a boolean property for the pdf document.
BOOL RpsSetBoolProp(id, prop, val)
| |||
|
|
DWORD id;
|
Session id.
| ||
|
|
int prop;
|
One of the following property type to set:
| ||
|
|
|
RPPROP_COMPRESS_TEXT
|
Compress text inside the pdf document.
Default = false.
| |
|
|
|
RPPROP_EMBED_FONTS
|
Embed font data in the pdf document.
Default = false.
| |
|
|
|
RPPROP_BOOKMARK
|
Include bookmarks. Default = true.
| |
|
|
|
RPPROP_HYPERLINK
|
Include hyperlinks. Default = true.
| |
|
|
|
RPPROP_ENABLE_GDIPLUS
|
Enable GDI++. The ssgp.dll file must be
installed for this property to be effective.
| |
|
|
|
RPPROP_RC4_128
|
Enable RC4 128 bit security when
password is specified.
| |
|
|
|
RPPROP_AES_128
|
Enable AES 128 bit security when
password is specified.
| |
|
|
|
RPPROP_PDFA_1B
|
Generate Pdf/a-1b compliant document.
| |
|
|
|
RPPROP_PDFA
|
Generate Pdf/a compliant document.
| |
|
|
|
RPPROP_NO_TOC_UPDATE
|
Do not update the original table-of-content.
| |
|
|
|
RPPROP_USE_ORIG_JPG
|
Place the original jpeg image data into the
pdf file.
| |
|
|
|
RPPROP_SHRINK_IMAGES_TO_FIT
|
Shrink RTF images to fit the page/table.
| |
|
|
|
RPPROP_PDFUA
|
Generate PDF/UA (user accessibility)
compliant PDF.
| |
|
|
|
RPPROP_EXACT_TEXT_PLACEMENT
|
Use exact text placement. This flag causes
the editor to emit character width for every
character. Default = false.
| |
|
|
BOOL val;
|
Specify TRUE or FALSE value for the
specified flag.
| ||
|
|
Return value: This function returns TRUE when successful.
| |||
RpsSetNumProp
|
|
|
|
|
|
|
|
|
Set a numeric property for the pdf document.
BOOL RpsSetNumProp(id, prop, val)
| ||||
|
|
DWORD id;
|
Session id.
| |||
|
|
int prop;
|
One of the following property type to set:
| |||
|
|
|
RPPROP_PICT_QUALITY
|
Specify picture quality from 1 to 5 where 1=lowest, 5-highest, 3=default.
| ||
|
|
|
RPPROP_PERM_FLAGS
|
Permission flags. The permission flags is effective
only when the OwnerPassword is also specified using
the RpsSetTextProp method.
One or more of the following permission flags can be
specified using the 'val' parameter:
| ||
|
|
|
|
PERM_PRINT
|
Allow printing of the
document
| |
|
|
|
|
PERM_MOD
|
Allow modification
| |
|
|
|
|
PERM_COPY
|
Allow copying of the
document to clipboard.
| |
|
|
|
You can specify more than one permission flags
using the 'or' operator.
| |||
|
|
int val;
|
The numeric value of the selected property.
| |||
|
|
|
| |||
|
|
Return value: This function returns TRUE when successful.
| ||||
RpsSetTextProp
|
|
|
|
|
|
|
|
Set a text property for the pdf document.
BOOL RpsSetTextProp(id, prop, val)
| |||
|
|
DWORD id;
|
Session id.
| ||
|
|
int prop;
|
One of the following property type to set:
| ||
|
|
|
RPPROP_AUTHOR
|
Author of the document
| |
|
|
|
RPPROP_TITLE
|
Document title
| |
|
|
|
RPPROP_SUBJECT
|
Subject
| |
|
|
|
RPPROP_KEYWORDS
|
Key words
| |
|
|
|
RPPROP_CRE_DATE
|
Creation date
| |
|
|
|
RPPROP_MOD_DATE
|
Modification date
| |
|
|
|
RPPROP_USER_PASSWORD
|
User password
| |
|
|
|
RPPROP_OWNER_PASSWORD
|
Owner password
| |
|
|
|
|
| |
|
|
LPBYTE val;
|
The text value of the selected property.
| ||
|
|
Return value: This function returns TRUE when successful.
| |||
ASP Interface
|
|
This chapter describes the usage of the RTF to PDF Converter within an ASP page. The
product includes an additional wrapper DLL called RPCC.DLL which is used to access
the converter within an ASP page. Please follow the following steps:
Copy RPS32.dll, rpcc.dll and other DLLs from the distribution zip files to the Windows
system directory, or any other directory available at the run-time. Now register rpcc.dll
using the regsvr32 system utility. The other dlls do not need registration. Now you are
ready to use this product within an ASP page.
Here is an example ASP page to show a conversion of RTF string into an PDF string:
<%@ LANGUAGE = "VBSCRIPT"%>
<%
Option Explicit
Dim sRTF
Dim sPdf
Dim obj
Set obj = Server.CreateObject("rpcc.converter")
sRTF = "{\rtf1 This \b is \b0 a test of \i RTF \i0 to \i PDF
\i0 Conversion.}"
if len(sRTF) > 0 then
sPdf = obj.ConvertBuffer(CStr(sRTF))
End If
Set obj = Nothing
%>
<html>
<head>
</head>
<body>
<p> Some text before </p>
<%
Function StringToByteArray(S)
Dim i, ByteArray
For i=1 To Len(S)
ByteArray = ByteArray & ChrB(Asc(Mid(S,i,1)))
Next
StringToByteArray = ByteArray
End Function
Response.Clear()
Response.Charset = ""
Response.ContentType = "application/pdf"
Response.AddHeader "Content-Disposition",
"inline;filename=" + "test.pdf"
Response.BinaryWrite(StringToByteArray(sPDF))
Response.Flush()
Response.End()
%>
<p> Some text after </p>
</body>
</html>
----------------------------------------------------------------
When the above asp file is loaded, IE displays generated pdf codes
-------------------------------------------------------------------
|
|
|
The method names used by the rpcc.dll are the same as the functions mentioned in the
Application Interface functions. However the 'Rps' prefix is not used by the rpcc method
names. For example, the RpsConvertFile function is named as ConvertFile within the
rpcc.dll file.
Also, the constants values are prefixed with an 'VAL_' prefix. For example, the constant
RPFLAG_SEGMENT_ONLY becomes VAL_RPFLAG_SEGMENT_ONLY.
|
|
|
|
The target application may not be a stand-alone Converter program.
Please click here for a detailed License Agreement.
The Desktop Developer License allows you to develop and deploy desktop (non-Internet) applications using this product.
Each desktop license allows one developer to use this product on up to two development computers. A developer must purchase additional licenses to use the product on more than two development computers.
The Desktop Developer license is not valid for server deployment.