HELP
We assure you that all support requests are taken
seriously and are being evaluated by the same team who developed this product.
Feel free to check out our FAQ or contact us by using the below form.
DO YOU HAVE ANY QUESTIONS?
If none of the below commonly asked questions answer your inquiry,
please don't hesitate to contact us directly. All questions are answered in less than 24 hours.
PRINTING FAQ
Where can I see a code sample for usage of pdfprint?
You can find code samples with a Visual Studio solution file in PdfPrinting.zip located at the downloads page.
There is a code for our PdfPrintLibraryTest demo application.
In that code, you can see:
- How to set all available properties in PdfPrint library (PaperSource, Collate, Copies, Pages, Duplex, Print in Color, Print range, Scale document, Landscape / Portrait, Printer Resolution, Paper Size, Show Printer dialog)
- How to change default printer in C# and get default values for the default printer
- How to get a list of available printers
- How to set watermark
In our PdfPrintLibraryMultiDocumentPrintTest application, you can see how to execute print multiple PDF documents as one single print job.
Can I use pdfprint in windows service?
Yes, you can.
The most important thing to know is that users running windows service where pdfprint is used must have rights to print to the selected printer - otherwise, it will not work.
Set up windows service to be run as a user account type:
User account type - causes the system to prompt for a valid user name and password when the service is installed and runs in the context of an account specified by a single user on the network
If you want to start windows service as a local system account, then the local system account must have printer rights.
NOTE: Following instruction were found at http://support.microsoft.com/kb/184291
To set up printers for the SYSTEM account, perform the following:
This method requires you to modify the registry using the Registry Editor.
WARNING: Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to reinstall Windows to correct them.
Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved.
Use this tool at your own risk.
Ensure that the user you are currently logged into on the server has the desired printers installed.
Launch the Registry Editor (Regedit.exe).
Select the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\Current Version\Devices
From the Registry menu, click Export Registry File.
In the File Name text box, type c:\Devices.reg.
Select the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\Current Version\PrinterPorts
From the Registry menu, click Export Registry File.
In the File Name text box, type c:\PrinterPorts.reg.
Select the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\Current Version\Windows
From the Registry menu, click Export Registry File.
In the File Name text box, type c:\Windows.reg.
From the Start button, select Run. Open Devices.reg in Notepad by typing Notepad Devices.reg in Run dialog box.
Replace the text HKEY_CURRENT_USER with HKEY_USERS\.DEFAULT
Save the file. Then import it into the registry by double-clicking the file in Windows Explorer.
Repeat steps are done for Devices.reg for PrinterPorts.reg and Windows.reg.
These steps only work for local printers.
If you are using PrintWithAdobe method, please also read Can PdfPrint use Adobe for silent printing?
Can PdfPrint use Adobe for silent printing?
PrintWithAdobe method uses preinstalled Adobe Reader / Professional for silent printing.
It works for 32 and 64-bit processes. This method will not work in these cases:
- in windows service / ASP.net service/Windows Task scheduler, it will not work if the installed version of Adobe Reader is higher than 9.5
- Adobe Reader / Professional isn't already installed on the computer where pdfprint library is used
Additional limitations with PrintWithAdobe method:
- Orientation: auto doesn't work correctly in some cases if PDF document has different size pages. Orientation is determined based on the first page, which should be printed, so if some of the next pages need a different orientation than the first page to be printed, it will not work correctly for that page.
- Scale: Fit to margins has the same effect as Reduce to margins.
- Option to enable/disable content centering isn't available. If Scale: None, then it isn't centered. If Scale: Fit margins or Reduce to margins, then it is automatically centered.
- Multiple pages ranges to be printed aren't supported. For example, 1-3 is supported, but 1-3, 4-6, or 1, 2, 3 is not.
- Printing multiple documents as a single print job isn’t supported.
- It isn't possible to set Watermark on a printed PDF document.
Printing with the default pdfprint engine doesn't have the above limitations.
Note about Adobe booklet printing: the Adobe logic produces a different booklet result than when a printer is directly instructed to print in booklet format. Only the printer option can be performed and it requires that the printer supports it, the Adobe logic is not supported.
Are paper sources (input trays) and output trays supported?
PdfPrint library has support for papersources.
private static PaperSource GetPaperSource(PrinterSettings printerSettings, string paperSourceName)
{
foreach (PaperSource paperSource in printerSettings.PaperSources)
{
if (paperSource.ToString().Equals(paperSource))
{
return paperSource;
}
}
return null; // Paper source not found
}
var pdfprint = new PdfPrint("your company name", "your key");
var printerSettings = new PrinterSettings();
pdfPrint.PaperSource = GetPaperSource("name of your input tray"); // it is case sensitive
PdfPrint library doesn't have support for output trays.
.NET PrinterSettings class has a property for setting PaperSource, and PaperSource is the standard-setting.
Output trays aren't standard printer property - and every printer which supports it handles it differently, so it isn't possible to have one general solution which will work for every printer.
So what to do if you want to print to a specific output tray?
The only option is that you use the property SettingDialog to show the Printer settings dialog.
If not set through SettingDialog, the printer default output tray will be used.
Can I include PdfPrintingNet.dll in my setup file? (ClickOnce, MSI, ...)
PdfPrintingNet.dll is a standalone dll library. It is signed with the public key.
It could be included in ClickOnce, MSI, and other types of Windows setup files.
How does page scaling in printing work?
PdfPrint has 3 different scaling options in printing:
1. Actual Size - it leaves the page as is. If the content of the page is larger than the printer printable area, then part of the content will be truncated.
2. Fit to margin - if the content of the page is larger than the printable area, the content will be resized so it fits the printer printable area.
3. Shrink to margins - if the content of the page is larger than the printable area, the content will be downsized. If it isn’t bigger than the printable area, the content size will stay the same.
Different printers have a different printable areas.
For PrintWithAdobe() method, due to technical limitations, Fit to margin behaves as Shrink to margins.
Is PdfPrintingNet.dll signed with a public key?
PdfPrintingNet.dll is signed with a public key.
Can I merge PdfPrint with ilmerge tool?
No, it won't work.
Executing ilmerge to merge pdfprint dll with another executable will not give you an error, but still it won't work.
PdfPrint dll is standalone and must stay like that - located in the same folder as the executable which uses pdf print library.
Can I use PdfPrint library in ASP.NET?
Silent printing will work if these conditions are satisfied:
- The selected printer must be "visible" to the IIS application pool user running ASP.NET web-site. That means that it must be possible to print to the selected printer from the computer where IIS is running. If you can print from any application from the IIS server to the desired printer as the user running the IIS application pool, then printing should also work from our library. Printing to a visitor's local printer isn't possible except if that printer is already visible from the IIS server.
- If you are using the PrintWithAdobe method instead of the default Print method, then the installed version of Adobe Reader must be 9.5 or older.
Converting PDF pages to images will work.
What is the difference between Viewer, Print and Full license?
Viewer license allows displaying PDF document in Viewer component without any limitations.
Also, it allows printing loaded document directly from Viewer component.
Viewer license doesn't support silent printing.
Print license allows to print or convert PDF document silently without any limitation.
If the Viewer component displays the document, it will show demo sign.
If the Viewer component prints the document, then it will print it without demo sign.
Full license allows to print, convert and display PDF document without any demo limitation.
Is printing multiple PDF documents as a single printer job supported?
From version 3.0.2.8, printing multiple PDF documents as one print job is available for our standard Print engine.
PrintWithAdobe(), due to technical reasons, doesn't have that functionality.
How does AutoRotate property work?
It rotates PDF content according to selected paper orientation.
If the page's content has a greater width than height, and the paper orientation is Portrait, it will rotate the content for 270 degrees.
If the page's content has a greater height than width, and the paper orientation is Portrait, then content will stay the same.
If the page's content has a greater height than width, and paper orientation is Landscape, then it will rotate the content for 270 degrees.
If the page's content has a greater height than width, and paper orientation is Landscape, then content will stay the same.
For the default Print() method, AutoRotate works per PDF page. If a PDF document has pages with different page sizes, the described logic will be applied to every one of them.
For PrintWithAdobe() method orientation is determined based on the first page's content, which will be printed. That can create problems if pages with different page sizes are printed. That is one of the know limitations of the PrintWithAdobe() method.
Can I set duplex, collate and copies per single document in multi-document print?
Duplex, copies, and collate can't be set per single document in multi-document print.
This is an internal limitation in the Win32 printing system, and we can't override that.
These three properties can only be set initially for the print job.
Other printing properties (paper size, paper source, page orientation...) are page-specific, and they can be set.
How does the PageAutoSize property work?
PageAutoSize is a tricky property.
It attempts to automatically set a printer paper size based on the size of the PDF page. Since there are various printers on the market with different capabilities, including the virtual printers, automatic set up of the printer, paper size can introduce a few problems.
The most common problems which can arise are:
1. The printer doesn't support the paper size set up by the PageAutoSize property
For example, if you try to print A3 PDF page size to the printer, which only supports the A4 format, that physically cannot work.
Some printers on the market support custom-defined paper sizes. Still, we can't be sure if the paper size provided by PageAutoSize property will be accepted from the printer or not. We don't have a reliable way to get that information from the printer driver if that custom size will be respected or not.
Virtual PDF printers (for example - CutePDF Writer) support all different kinds of custom page sizes because they don't have physical paper size limitations. Also, not all printers on the market have an option to define a custom paper size.
To avoid setting custom paper size on the printer, which doesn't have such an option, we have added a new property to our library called AllowCustomSize. If that property is true, PageAutoSize will set a custom paper size if the calculated paper size isn't found. Otherwise, the current printer default paper size will be used. By default, the AllowCustomSize property is false.
2. The printer supports the required paper size, but automatic tray selection isn't available.
Some printers have more than one paper source tray. Each tray can be used for a different paper size - for example, Tray 1 is used for A4 while Tray 2 is used for Letter.
If you try to print A4 PDF page size to A4, but the printer driver isn't able to automatically select a correct paper tray that contains A4 paper - that won't work. However, in most cases, a printer driver will be able to handle such a scenario.
But, in some rare cases, where that doesn't work, we have added a property PaperSourceTrayInfo, which helps our library set PrinterTray correctly. That property has to be hard-coded to work properly. Please note, as it's not practical to use the PaperSourceTrayInfo property, this is more of a workaround for some specific rare cases.
How does the centered property work?
The printer has physical printer margins - an area where it can print. So, for some paper sizes (like A4), if the printer isn't a virtual one (like Microsoft PDF Print), the printer will start printing at the left margin, top margin position.
Printable area = paper size - printer margins.
Content is centered according to the printable area, so if the left and right margin or top and bottom margins aren't the same, the content will not be perfectly centered on the paper, and that is by design.
VIEWER COMPONENT FAQ
How to license a PdfViewer object?
First, you need a valid viewer license.
PdfPrintingNet library has 3 different licensing types: Viewer, Print, and Full.
If your license type is Viewer or Full then you have a valid Viewer license and you have received the correct license key in an email when you purchased the PdfPrintingNet library.
In your source code, you will have something like this:
var pdfViewer = new PdfViewer();
pdfViewer.SetLicenseInfo("your company name", "your license key");
When calling the Print() method on the Viewer component I get the print dialog. Can I silently print a document?
No, for advanced print settings or silent printing you need to use the Full license of our PDFPrinting.NET library.
Can I use Viewer component in WPF?
Yes, it is possible to use it through WindowsFormHost component.
We recommend that you look at our demo application PdfViewerPDFDemo located in PdfPrinting.zip.
To license it:
In PdfViewerWPFDemo project -> MainWindows.xaml.cs, after InitializeComponent(); line, please add this line:
((PdfViewer)(windowsHost.Child)).SetLicenseInfo("your company", "your demo key");
Does the Viewer component respect PDF permissions?
Our library retrieves the following permissions from PDF document:
- Modify
- Comments / Annotations
- Document Assembly
- Content Extraction
- Content Extraction For Accessibility
- Filling of form fields
- Full qualify print
Our library's current version uses only Print / Full quality print and Content Extraction / Content Extraction For Accessibility.
Others are available only as information.
In the future version, where it will be possible to edit PDF documents, other permissions will be respected.
How to add PdfViewer component on my Windows Form in design time from Visual studio?
1. In your project reference PdfPrintingNet.dll
2. Build your project.
3. In Visual Studio go to Toolbox -> Choose Items -> Browse... -> Select PdfPrintingNet.dll on your disk
4. That will add PdfViewer in .NET framework components. Check it and press OK.
Can I remove some of the options on the toolbar of Viewer component?
Yes, you can completely hide the toolbar, or you can hide some of its options. For example, you could hide the page selection elements and then only allow your users to view a single page.
You can change it:
1. from Visual Studio in design time - in the properties window of the toolbar
2. programmatically from your code
Why is print button on the Viewer component grayed out?
This occurs in case the PDF document which you opened has permissions set to disallow printing.
You can check out the permission of the document by calling the GetPermissions method on the component.
How can I translate PdfViewer?
Required:
- PdfPrintingNet.dll must be version 4.5.2.0 or newer
- Translation file with translated text
- In runtime, you call method pdfViewer.TranslateViewer(locationToTranslationFile);
We suggest that you use translations_en.txt from Samples directory in PdfPrintingNet.zip as a template.
In translations_en.txt there is a list of all strings used. Translate the part after "=" sign.
We suggest that you read notes at the bottom of the translations_en.txt.
What are available shortcuts on Viewer component?
Shortcut | Operation |
---|---|
CTRL + A | Select all text |
CTRL + SHIFT + A | Deselect all text |
CTRL + C | Copy selected text or image to clipboard |
SHIFT + RIGHT | Go to next page |
CTRL + P | |
CTRL + O | Open |
CTRL + F | Search |
CTRL + Y | Zoom to |
CTRL + 0 | Zoom to fit to page |
CTRL + 1 | Zoom to actual size |
CTRL + W | Close Document |
CTRL + B | Toggle bookmarks |
CTRL + D | Show document info |
CTRL + SHIFT + ADD | Rotate clockwise |
CTRL + SHIFT + SUBTRACT | Rotate counter-clockwise |
PAGE UP | Go to previous page |
PAGE DOWN | Go to next page |
SHIFT + LEFT | Go to previous page |
SHIFT + RIGHT | Go to next page |
CTRL + SHIFT + N | Go to page |
HOME | Go to first page |
END | Go to last page |
ALT + LEFT | Go to previous visited page |
ALT + RIGHT | Go to next visited page |
EDITOR MODULE FAQ
Where can I see some examples how to use PdfEdit?
In PdfPrinting.zip (available in downloads page) there are sample applications with its source code.
There is source code for three sample applications:
- CreateInvoice - simple example which creates an invoice. A good example to see how to create new PDF document and how to write text with special font and images to it.
- DocumentMergeSplitExtractRemove - how to extract, remove, split or merge pages from existing PDF document.
- PDFProtection - how to set PDF encryption and user access permissions.
Does PdfEdit support AES256 encryption and which encryption to use?
PDFEdit supports all encryption algorithms defined by the official PDF reference manual.
Supported encryption algorithms are RC4 40 bit, RC4 custom length key length, RC4 128 bit, AES 128 bit, AES 256 bit - weak type (not recommended!), AES 256 bit - strong type.
AES 256 bit is the most secure encryption, but not all PDF readers can use it yet. For good security and compatibility, we suggest AES 128 bit.
Which are user access permissions supported in PDFEdit?
PDFEdit supports all user access permissions defined by official PDF reference manual.
Supported user access permissions are: Permit Print, modify document, extract content, annotations, forms fill, accessibility extract content, assemble document, and full quality print.
You can set user access permissions, but it is up to PDF reader if those permissions will be respected.
REFERENCE DOCUMENTATION
The reference documentation contains all classes, methods, and
properties offered through our library. In case you are looking for a tutorial,
please download our Quick Start Guide.
QUICK START GUIDE
The reference documentation contains all classes, methods,
and properties offered through our library. In case you are looking for a tutorial,
please download our Quick Start Guide.