- Can ABCpdf convert my Microsoft Office documents to PDF?
-
To convert Office documents ABCpdf .NET requires either WordGlue .NET, or the use of MS Office or OpenOffice.org as helper applications. We would recommend you use the current versions, which must be installed on the same system as ABCpdf.
WordGlue .NET is our own layout engine supporting doc and docx formats. It is designed specifically for unattended use from multiple threads in high stress, restricted permission environments. It comes complete with projects showing how to integrate with ABCpdf.
If you are using MS Office or OpenOffice.org you can select which application is used by setting the ReadOptions.ReadModule property.
To use Microsoft Office, set the property to ReadModuleType.MSOffice. Please see the ABCpdf Feature Chart for supported MS Office versions.
To use OpenOffice, set the property to ReadModuleType.OpenOffice. You will need OpenOffice.org 3 installed.
Although it is possible to separate out individual applications from MS Office or OpenOffice we would not recommend this. There is a lot of commonality between the different applications so it is generally a good idea to install the entire suite. Certainly it is not possible to access particular DLLs as ABCpdf interacts with MS Office or OpenOffice.org.
Using older versions of ABCpdf you may wish to call Microsoft Office via the XPS printer driver. To do this you should set the ReadModule property to ReadModuleType.XpsAny. Printing via the XPS printer driver requires the PrintHook DLLs and the correct file-extension association of the document types with the applications (e.g. MS Word, Excel, etc). The Microsoft XPS Document Writer printer must also be installed (with Vista, .NET framework 3, or the XPS Essentials Pack).
You need code like this:
'--- MS Word
Dim theDoc As Doc = New Doc()
Dim xr As XReadOptions = New XReadOptions()
xr.ReadModule = ReadModuleType.MSOffice
theDoc.Read("in.docx", xr)
theDoc.Save("out.pdf")
'--- OpenOffice
Dim theDoc As Doc = New Doc()
Dim xr As XReadOptions = New XReadOptions()
xr.ReadModule = ReadModuleType.OpenOffice
theDoc.Read("in.docx", xr)
theDoc.Save("out.pdf")
Please see the documentation of Doc.Read and ReadOptions for more details.
For information about and help setting up OpenOffice.org and Microsoft Office in reduced permission environments please see Section 3.18 and Section 3.20 respectively.
- Why does the trial version ask me for a license key?
-
ABCpdf is a component not an application. The PDFSettings application is simply for entering a license key when you purchase one.
You do not need a license straight away - the component will work for 30 days without any intervention. All you need to do is look at the documentation and start writing code.
If your web application is reporting that your license has expired...
Log on as Administrator and open up the PDFSettings application and see what it says. It will probably tell you that you have a trial license - this is OK.
If it says your license is OK then restart and try your code again. If you still get the same message then you have a permissions issue.
ABCpdf needs to be able to read the license key from the registry. If your web application is unable to read this key it will not work. You need to enable read access to the ABCpdf registry settings at:
HKEY_LOCAL_MACHINE\SOFTWARE\WebSupergoo\ABCpdfNET
or
HKEY_LOCAL_MACHINE\SOFTWARE\WebSupergoo\
You can adjust registry permissions using regedt32. Please take the relevant precautions when modifying the registry - if you are not sure what these are then please do not perform this type of operation.
- Can I import an existing PDF document and then manipulate it on the fly?
-
ABCpdf will allow you to open, modify and save PDF documents.
ABCpdf will allow you to draw on top of PDF documents or add or delete pages or modify document data. However because of the way that PDF documents are structured it's unlikely that you'll be able to reflow existing content.
So if there are empty spaces which you can draw your entries into that will work great. Indeed you might want to draw a white box over existing content and then draw on that.
The TextOperation class will allow you to extract text from parts of PDF documents, by page, by area or by a combination of both. Using this class it is easy to match parts of that text back to locations on pages, styles and bits of the raw PDF content stream. The documentation for this class includes a code sample showing how to search a PDF, highlight keywords and then save the result.
The ImageOperation class allows something similar for images. It allows you to determine what images are present in a document and where in the PDF they are used. This allows the extraction of information such as resolution in DPI.
If you need to work at a lower level, the GetText function allows you to extract text and style information formatted as SVG.
Text extracted from a simple "Hello World" PDF as SVG looks something like this:
<?xml version="1.0" standalone="no"?>
<svg width="612" height="792" x="0" y="0" version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<text xml:space="preserve" x="0" y="76.8" font-size="96" font-family="Times-Roman" textLength="514.56" >Hello World!</text>
</svg>
So what can you do with this SVG? Well you can drop it into a web browser and view it. However the key advantage of SVG is that it's easy to deconstruct (it's just XML) so you can tell where on the page items of content are located and how they are styled. If you want to extract specific items of text like bylines or titles then SVG is the way to go.
ABCpdf also supports an export format called SVG+. This is a superset of the SVG specification and includes details that map SVG content back to precise locations in the PDF content stream. This information allows you to edit and re-save existing PDFs. For an example of how to do this see the ABCpdfView project which comes with ABCpdf.
Reflowing text is more difficult. Shifting existing content to make room for a newly added item would require that content on the current page be shifted down, then any overflow moved to the next page, which again might require a reflow. This type of technique is potentially extremely complex and is best avoided.
If you really need to do a large scale reflow then your best option is to export the entire PDF as another format like HTML. Then modify the HTML and use it to create a new PDF. However note that the round trip is likely to take time and the output may be slightly different from the original.
- My code works on my development server but fails when I deploy. What gives?
-
The vast majority of configuration issues are related to security and permissions.
Dev servers often operate a more relaxed security policy than staging or live servers and so this kind of problem often becomes apparent only during deployment.
Your first step should be to run ABCpdf interactively while logged on as Administrator. This will allow you to eliminate permissions as a source of the problem.
If you are running under .NET you will need to create and compile a simple VB or C# application to perform some basic operations. You can download sample projects here.
If you are running under ASP you can create a VBS script to mimic the effect of your ASP. Copy the following text into a text file and then rename it mytest.vbs. If you are on an x86 system you can just double click to run.
If you are on an x64 OS you can run your VBS in either 32 or 64-bit mode. Double clicking will run in x64 mode however you should also test 32-bit mode. You can do this by dropping your VBS on the wscript.exe app you will find in SysWow64. Please try both modes and let us know that both are working.
Set d = CreateObject("ABCpdf13.Doc")
d.FontSize = 96
d.AddText "Hello World!"
d.Save "mydoc.pdf"
MsgBox "Finished"
If the issue appears to be permission related you can track down the cause of the problem using the security troubleshooting procedure detailed on this page.
Alternatively it can be possible to completely bypass security problems by running your code in a Component Package under .NET Enterprise Services or COM+. This has a number of advantages.
- It allows your code to run in a completely different process from your web code thus isolating the two.
- It allows you complete control over the user which your code runs as without impacting the security of your web code. All you do is change the user using the Component Services Administration Tool.
- Because your web code and your ABCpdf code are operating in different address spaces there is more free space in each process.
- You can tell your component package to shut itself down when it's not being used.
If you are using ABCpdf .NET you'll need to write a .NET Managed Component wrapper round your code. The PDFEnterpriseServices example project under the ABCpdf .NET menu item shows you how to do this for converting HTML into PDF. If you are using ABCpdf ASP the process is even easier - you may find our ABCDrawHTML COM+ instructions helpful.
- When I convert HTML I get an empty PDF, or see errors like:
"HTML render is blank"
"No MSHTML document is available"
"Unable to add image"
"Unable to read file"
"Unable to render HTML"
-
Under ASP.NET you will need to set the "Load User Profile" option to "true" in your application pool's configuration.
If you are experiencing difficulties converting HTML we recommend updating to the latest release on our downloads page before continuing.
First read the previous section carefully.
Firewalls, DNS and proxy servers can present particular problems for URL rendering because they may require some kind of logon. Your IIS user will most likely not have a logon. You need to allow ABCpdf to logon automatically.
Windows Authentication can produce a challenge that your IIS user may not be responding correctly to. You will find details of how to manage Authentication in the documentation.
If this does not help...
First work through some simple sanity checks and common causes of this type of issue.
- Do ensure you can browse to the appropriate location using Google Chrome or the ABCpdf Chrome Engine while logged on as Administrator (on the system where ABCpdf runs). Make sure Chrome does not throw up any blocks or warnings. ABCpdf requires a clear route through to the page. If you are using the Gecko engine then install Firefox on this machine and try viewing your URL using that too.
- If you are rendering a URL on your localhost then ensure that the IIS user has read access to this location.
- Make sure that under ASP.NET you have set the "Load User Profile" option to "true" in your application pool's configuration. If you do not then you may get access errors related to C:\Windows\System32\config\systemprofile\AppData and subdirectories.
- It is our experience that it is surprisingly common for web servers not to be able to resolve URLs to themselves. This means that when testing using an IP address your code will work but when you try and render a web page on the local server using a URL you may get issues.
- It is our experience that it is surprisingly common for web servers to be able to access HTTP URLs but not HTTPS ones. If you are using an HTTPS URL then try the equivalent as HTTP to see if the problem is related to SSL.
- If you are using ABCpdf's legacy MSHTML engine please note that it needs a compatible Internet Explorer version on the same system. Please see the feature chart for details.
- If you are using ABCpdf's legacy MSHTML engine note that the default value of HtmlOptions.HostWebBrowser is true, which provides greater compatibility with a wider range of HTML and JavaScript. However this setting also requires a greater level of permission. If sufficient permissions are not available you may see errors like "Windows error 5" or "Access is denied" or "Unable to create memory-based MetaFile" or "No MSHTML document is available". If this is the case try setting the Doc.HtmlOptions.HostWebBrowser property to false prior to calling AddImageUrl/Html. If you do not have access to the source code you can change the default by entering a HostWebBrowser registry key - details in the ABCpdf .NET documentation. If you do this on an x64 server be sure to set both the 64-bit registry key and also the 32-bit Wow3264Node based key.
- If all this looks fine and you are still seeing problems we strongly suggest putting in ten minutes with ProcessMonitor. In most cases it will flag an obvious cause. Be cautious with ProcessMonitor filters as problems may not always be quite where you expect them to be. However, in general a filter on "Result contains DENIED" will pick up most issues. You will find details on how to use ProcessMonitor on the "How do I use Process Monitor to find permissions issues?" section of this page.
- Lack of access to the windows/temp directory is a frequent cause of problems. Ensure that your IIS user (e.g. ASP.NET or IUSR_MACHINENAME) has read/write permission and also (if it fits with your security policy) the ability to create folders. You may also find that ASP.NET is being denied access to its own preferences (e.g. C:\Documents and Settings\MACHINENAME\ASPNET or C:\Documents and Settings\NetworkService.
If this does not help...
You need to establish a test case to establish the boundaries of the problem.
- If you are using ASP .NET please download the .NET base test case. If you are using Classic ASP, use the COM base test case.
- Log on as Administrator. Because the code in the test cases is run as the logged on user you are bypassing any permissions issues which may exist in ASP.
You first need to run the base test cases as-is. These will default to a simple render of a file based URL. If you see an issue then restart and try again. If you still see an error then ensure your machine is fully patched and up to date and then try again. If the error still occurs then please contact us describing exactly what you've done and what error you are seeing.
- Assuming the base test case works then you need to try a different URL. Try one on the web (e.g. http://www.google.com) but do first ensure that you can browse to that URL using Google Chrome on the same machine as you are running ABCpdf on. You should see the same content in Chrome as you do in your output PDF. If not, please contact us describing exactly what you've done and sending us the URL and the incorrect output PDF.
- If you are using the Gecko engine then install Firefox on this machine and repeat this same test. As well as viewing the URL you should also print it to PDF or XPS and look at that output. This is necessary because the Gecko engine may use different stylesheets for different media types and so screen and print output may be quite different.
- Assuming your web based URL works then try the URL you are using in your code - the actual page you want to render. See what kind of output you get.
If the output is correct then copy the exact same code to an ASP page and try it. Any difference between the operation of the code under ASP and in the test cases will be due to permissions issues. See this support page for how to resolve permissions issues.
If the output is incorrect then browse to that URL and save the web page using Chrome. Then copy the saved web page to the same web site and try rendering that (static) page using ABCpdf. If the output from the static page is correct then your dynamic page is not returning the output you think it is. If the output from the static page is incorrect then send us through the saved page and the output PDF and tell us what's wrong with the PDF.
Please work through these instructions before contacting us. If you can tell us what you've done and what results you've had this will save us all a lot of time.
- My code is throwing errors like "'Unable to render HTML. Page load timed out. Unable to load page".
-
The typical reason a timeout is reported is because a page takes too long to load. ABCpdf expects a page to finish loading within 20 seconds, or the time specified by HtmlOptions.Timeout. If it does not it will time out. So... hardwire your URL into the code so you are sure it's correct. Open the same URL in Google Chrome. How long is your page taking to load when you view it in Google Chrome?
Assuming it takes longer than 20 seconds you need to adjust the timeout - see the HtmlOptions.Timeout property.
Do not make the timeout too high - keep it realistic. If you set a HtmlOptions.Timeout value of ten minutes and a HtmlOptions.RetryCount of 5 then you are telling ABCpdf that it can spend up to an hour trying to get the page. If this happens, to all intents and purposes it will look as if the process has hung.
Occasionally timeouts may be reported because ABCpdf does not have permission to access a page. However this is unusual. If you suspect that this may be the case you will need to run through the blank page troubleshooting instructions in the previous section.
- Why does my font not work?
-
ABCpdf will allow you to use any valid TrueType or Type 1 (PostScript) font.
ABCpdf will not embed fonts which do not explicitly permit it. This is a measure in place to protect you from inadvertently infringing copyright. However you can override this behavior and force ABCpdf to embed these fonts. See the Doc.EmbedFont method and the Doc.HtmlOptions.FontProtection property in the documentation for details.
ABCpdf maintains a font cache. This means that for ABCpdf to pick up on a newly installed font you will need to restart any processes that are using ABCpdf.
Alternatively you can pass the path to your font file to the AddFont or EmbedFont method. This will automatically load the font file. Do not move the font file after doing this - ABCpdf relies on fonts staying in place.
ABCpdf will automatically find any font in the Fonts folder. However applications such as Adobe Type Manager may place the font files in a different folder. If this is the case then ABCpdf will not be able to see them.
Sometimes permissions are placed on individual font files which may restrict access from restricted permission accounts such as ASP or ASP.NET. If you change font permissions (including when you add a new font to the system), you may need to reboot to ensure ABCpdf sees the changes.
Occasionally TrueType fonts are corrupt or non-standard. This can cause problems for ABCpdf (which will refuse to recognize them) or Acrobat (which will refuse to use a font embedded in the PDF). However this type of problem is relatively infrequent and tends to be restricted to unusual fonts such as bar-codes.
If you hit a problem you think is related to a corrupt or nonstandard font please mail us the font and we'll see what we can suggest.
- How do I automatically print my PDF documents?
-
You can use ABCpdf to render your PDF. However while ABCpdf will manage the rasterization you will need to manage the printer control. The ABCpdfView example project (included with the ABCpdf .NET install) shows how to do this and provides starter code for printing using ABCpdf.
Alternatively to script Acrobat to print a document you can run it silently from the command line. Use the following syntax.
AcroRd32.exe /t path printer driver port
The path is the path to the PDF document. The printer is the name of the printer. The driver is the name of the driver - as it appears in the 'Driver Used' box. The port is the printer port (this cannot contain backslash characters).
You can also script Acrobat to print via Automation. You need to use the AVDoc.PrintPages... suite. More information can be found on the Adobe web site.
- How do insert bar codes into my PDF documents?
-
There are lots of free and commercial bar code fonts which will allow you to do this quickly and easily.
ABCpdf will allow you to insert barcode TrueType fonts into your PDF and thus produce barcode output. Please ensure you embed the barcode font and please ensure you have permission to do this.
We suggest starting at the Barcode 1 site for your code 39, code 93, code 128, DataMatrix, Interleaved 2 of 5 & 2 of 5, OCR-A & OCR-B, PDF417, Postnet and UPC/EAN barcode fonts.
Look for TrueType fonts which are embeddable into PDFs for use by ABCpdf.
- How do I change the PDF Page Size?
-
See the Doc.MediaBox property as detailed in the documentation.
- My documents do not measure up when I print them. Why?
-
In every case we've come across the issue has not been with the PDF output produced by ABCpdf - it's with the way that Acrobat and Windows does the printing.
Normally you can solve these issues by adjusting the PDF and by ensuring that the print options on Acrobat are correct.
Check the print dialog. Make sure you do not have the 'Shrink oversized pages to paper size' or 'Expand small pages to paper size' or 'Auto-rotate and center pages' options checked.
Are you printing on a PostScript printer - if not you may not get exact output.
Try using AddGrid to add a background grid to your image. This may show how the PDF is being changed as it moves from screen to paper.
You may find it helpful to specify a CropBox for your document (this may affect the way that Acrobat prints pages). To insert a CropBox for the current page use:
theDoc.SetInfo(theDoc.Page, "/CropBox:Rect", "30 30 562 732")
' standard mediabox inset by 30 points
' you will probably need to adjust this rect
If you cannot see a solution send us a simple example of a PDF which prints correctly and one which does not. If you can do this we should be able to find what it is that is different between the two. We can then tell you how to achieve this using ABCpdf.
- Can I convert my PDFs to JPEG / TIFF / GIF using ABCpdf?
-
Yes - see the Doc.Rendering property as detailed in the documentation. You need an ABCpdf Professional License for PDF rendering.
Simply write code like this (this is ASP but the .NET code would be very similar):
Set doc = CreateObject("ABCpdf13.Doc")
doc.Read "c:\myfile.pdf"
doc.PageNumber = 2
doc.Rendering.Save "c:\mypreview.jpg", ""
- Why am I having problems displaying my PDFs in a browser?
-
The combination of a browser and Adobe/Acrobat Reader is not always trouble free - particularly under HTTPS or using older browser versions. It's difficult to know exactly where the problem lies because there is an interaction of the Operating System/IIS, the browser and Adobe/Acrobat Reader. Any of these can be the cause.
Sometimes browsers get 'stuck' on a particular content type and insist on displaying your PDF as HTML. In this case you will see random text starting with %PDF. Often this can happen if you send PDF data to a window which was previously displaying HTML.
Sometimes server-side debugging results in extra data being inserted into the content stream. While this may not matter for HTML it will corrupt binary documents like PDF.
Sometimes your code may inadvertently insert extra data into the content stream. Again this will corrupt the PDF.
HTML Compression is something that some versions of Adobe/Acrobat Reader can be unhappy about. If your server provides compressed output then Acrobat may simply display a blank page. You should know whether you've enabled IIS compression or not - it's off by default. If you are really not sure then use a utility like IEWatch to check the content headers being returned. If you see gzip then you are seeing compressed content. (If you are using IIS6 compression, this can be switched off on a file by file basis by altering settings in the Metabase.)
File caching can cause problems, especially when working on secure connections. If the cache headers are set to no-cache or the cache expires before Acrobat sees the document then the browser can get into a situation in which it asks Acrobat to open a document only to delete it before Acrobat can do so. Look out for Response.CacheControl = "no-cache", Response.AddHeader "Pragma", "no-cache" and Response.Expires = -1.
For testing purposes you may wish to change the content-disposition from 'inline' to 'attachment'. This will allow you to download the data rather than view it in your browser. You can then check the downloaded document using Acrobat or a hex editor. All PDFs should start with "%PDF" and should end with "%%EOF".
Alternatively if the problem is that PDFs seem to be cached you may wish to check the 'Enable Content Expiration' checkbox you will find under the Web Site Properties.
(If you are using IIS 7.5 or higher, and ASP Classic - but not ASP.NET - we've seen reports of a bug in IIS's handling of the content-length HTTP header. Does streaming a PDF work if you remove it?)
We would suggest two steps:
- Your first step should be to eliminate ABCpdf as the cause. Why not save the PDF to disk at the same time as sending it to the client? That way you can establish that the PDF is fine. If you want to take it further you could then read the PDF data from disk and stream it direct to the client.
- The example site streams PDF data direct to the client. So install the example site into a new virtual directory and establish if the same issue exists for the example site. If it works then it's simply a matter of moving your current code base and the example site code base towards each other until you find the cause of the issue.
If this does not help please do get in contact with us describing exactly what you've done.
- Why are my styles and images not working when I use AddImageHtml?
-
HTML does not exist within a file and so it does not have a location.
External stylesheets and images are often referenced via relative URLs. Because the HTML has no location it is impossible to resolve these relative references.
The way you deal with this depends on the HTML engine you are using. See the AddImageHtml documentation for details.
As an alternative you can save your HTML to file in an appropriate location and then use AddImageUrl with a "file:///" protocol URI.
- Can I put ABCpdf .NET on my shared / hosted site?
-
In general - yes.
You need to follow the instructions in the Concepts: Manual Installation section of the documentation. Any DLLs will need to be placed in your bin directory and the license (or trial license) key will need to be incorporated into your code.
Most installations of ABCpdf .NET on shared servers are seamless. However you need to be aware that you are a guest on the server and your host may have locked down permissions in ways which will make your life difficult. If this occurs there is typically little that either you or us can do about it.
This is why we recommend deployment on a dedicated or virtual private server (VPS). VPS hosting is now incredibly cheap and the level of control it allows is only one of the very significant advantages it affords. It is a truly wonderful deal.
If you have to deploy on a shared site the essential thing to do is to deploy early and discover any issues before they become major problems.
- Why are my pages being cached when I use AddImageUrl and stream the resultant PDF to the browser?
-
There are two possible causes.
The first is that the URL is in some way being cached. Just because you've disabled the ABCpdf cache does not mean that it's not being cached somewhere else. See the HTML / CSS Rendering section of the documentation for details.
The second is that the PDF itself is being cached. Most commonly this kind of thing can happen if you are streaming the PDF direct to the browser and you have certain IIS settings (e.g. Expire Content) disabled.
Your first step should be to narrow down the problem. Why not save the PDF to disk at the same time as sending it to the client? That way you can establish whether the PDF itself is being cached or whether the URL is being cached (resulting in the same PDF being created again and again).
If the URL is being cached you will need to look at the dummy URL method. ABCpdf is not doing the caching but something else is and you need to work around it.
If the PDF is being cached you will need to look at your IIS settings. Again ABCpdf is not doing the caching (and indeed it cannot cache the PDF in this way) it is something which is happening either in IIS/ASP or on an intervening proxy server or on the client.
In most cases the dummy URL method (detailed in the documentation) is the fastest route to a solution.
- Why am I finding it so difficult to work with Adobe Designer forms? Why are my Acrobat 7 forms working so differently from my Acrobat 6 ones?
-
Adobe Designer may be installed as part of Adobe Acrobat but it is a fundamentally different application which simply happens to use PDF as an output format.
In more detail...
You can use Acrobat to edit forms using the Advanced Editing tools available under the Tools menu. However if you choose items from the Forms menu or toolbar then you will probably find that you end up editing your form in Adobe Designer rather than Acrobat.
Adobe Designer uses PDF as an output medium. However the way that Designer operates means that forms created by Designer are fundamentally different from forms created by Acrobat.
For example an Acrobat created form typically contains a background and then a set of fields. The fields operate separately from the background.
Adobe Designer created forms do not make this distinction. They use a separate data store to specify the fields. The PDF content is merely the visible rendition of this field specification. The underlying field specification is made up of chunks of XML embedded in the PDF.
Because Designer documents are PDF documents you can add content to them using standard ABCpdf methods of adding PDF content. However if you then open them in Designer the content will most likely be deleted as Designer recreates the PDF appearance using the separate field specification.
Equally because the PDF output is merely the visible rendition of a separate field specification the fields and background may be tied to each other. So you might use ABCpdf to delete a field and find that the border has been left behind.
If you want to modify forms you will generally find it easiest to work with Acrobat created forms than Designer created ones.
- I am having problems with OpenOffice.org when I try to convert documents to PDF. How do I troubleshoot these?
-
Please do consider whether you should be using WordGlue .NET in place of this type of interactive application.
WordGlue .NET. is our own layout engine supporting doc and docx formats. It is designed specifically for unattended use from multiple threads in high stress, restricted permission environments. It comes complete with projects showing how to integrate with ABCpdf.
Troubleshooting tips for OpenOffice.org issues can be found here...
- I see the exception "Unable to load DLL 'ABCpdf13-64.dll': The specified module could not be found." or "Unable to load DLL 'ABCpdf13-32.dll': The specified module could not be found." (or "Unable to load DLL 'ABCpdf13-64.dll': The specified module could not be found." or "Unable to load DLL 'ABCpdf13-32.dll': The specified module could not be found.")
-
This means that Windows is unable to find the named DLL. This is typically because the software has not been properly installed, or the CLR is trying to find a version that does not exist on your system. You should output the value of IntPtr.Size. If it is 4, your application is running in a 32-bit process and you should use 32-bit ABCpdf. If it is 8, you should use 64-bit ABCpdf.
If you have a 32-bit version of ABCpdf installed but your project is running in 64-bit mode you will get an error to say that "ABCpdf13-64.dll" could not be found. To fix this you could change your project properties to target an x86 platform. Alternatively you could install ABCpdf x64, so that it works in both 32 and 64-bit modes.
The default set-up of IIS (in 64-bit Windows) runs in 64-bit mode. However, Visual Studio has a tendency to start ASP.NET in 32-bit mode if you debug with Visual Studio. Also, if your server also runs pages that use third-party COM components that work on 32-bit Windows, chances are that IIS on your server is running in 32-bit mode.
ASP.NET can run in 32-bit or 64-bit mode on 64-bit machines. For more details, please see IIS7 - Running 32-bit and 64-bit ASP.NET versions at the same time on different worker processes.
The minor version (e.g. 12.3.0.0) of the ABCpdf.dll and ABCpdf13-XX.dll files must be the same.
If the ABCpdf DLLs are in the bin folder, and your application is on a
UNC share, you may need the following code before any ABCpdf code:
if (HttpRuntime.IsOnUNCShare)
{
var path = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Process);
if (path != null)
{
if (path.IndexOf(HttpRuntime.BinDirectory, StringComparison.OrdinalIgnoreCase) < 0)
{
path = path.Trim().TrimEnd(';') + ";" + HttpRuntime.BinDirectory;
Environment.SetEnvironmentVariable("Path", path, EnvironmentVariableTarget.Process);
}
}
}
A Professional license covers use of the 64-bit or 32-bit download, while the Standard Edition is only available in 32-bit form.
- I am having problems with MS Office/Word/Excel when I try to convert documents to PDF. How do I troubleshoot these?
-
Please do consider whether you should be using WordGlue .NET in place of this type of interactive application.
WordGlue .NET. is our own layout engine supporting doc and docx formats. It is designed specifically for unattended use from multiple threads in high stress, restricted permission environments. It comes complete with projects showing how to integrate with ABCpdf.
If using ABCpdf version 8 or newer, please see our guide for configuring and using the MSOffice read module...
For older versions of ABCpdf, or help in setting up the XpsAny read module, please see our troubleshooting tips for Microsoft Office issues...
Please note that the error "Could not find office app window (0)" results from a failed FindWindow call, which normally happens when launching Office from a Windows Service (including IIS). Office and ABCpdf do not run under the same account, or the account has no Window support. Please work through one of the procedures mentioned in the above link.
- How do I manually install ABCpdf? What do I copy to the bin directory? How do I get the license recognized?
-
We would strongly recommend installing ABCpdf by running the installer while logged on as Administrator. This is for two reasons - simplicity and standardization.
Installing manually is not difficult. Nevertheless we see a surprising number of problems related to incorrect manual installations. Make your life easy and do things the simple way.
While you may know what you've installed, a couple of years down the line your colleagues may not. If we get a support request asking about ABCpdf we will be able to help if the DLLs are installed in a standard way. If they're installed in some location that made sense to you, then things get a lot more complex. Make your colleagues' life easy and do things the standard way.
However if you have to install manually it is pretty simple. You will need to copy some files onto your machine and you will need to write a couple of lines of code to install your license. Please search the documentation for 'Manual Installation' and you will find details.
- Why does Gecko take longer to render the first page?
-
It's possible Gecko is timing out while attempting to validate a site's SSL certificate.
To set a shorter timeout and work around the problem, open the Group Policy Editor in Windows (gpedit.msc) and navigate to
Local Computer Policy > Computer Configuration > Windows Settings > Security Settings > Public Key Policies.
Open the properties for Certificate Path Validation and select the Network Retrieval tab.
- Why is my COM or Classic ASP installation not working with ABCpdf?
-
The best and safest way to install is to run the ABCpdf installer. While manual installation is simple, it is surprising how many errors are related to failures to perform this step correctly. We would thoroughly recommend running the installer rather than attempting a manual installation.
If you must install manually please note that ABCpdf .NET installation is standard .NET xcopy. COM installation is a standard Microsoft regasm command. It is very simple but you must get it right. If you do not then nothing will work. See the ABCpdf .NET documentation for further details.
To test your COM installation please run a simple hello world VBS. Copy the following text into a text file and then rename it mytest.vbs. If you are on an x86 system you can just double click to run. However if you are on an x64 OS you can run your VBS in either 32 or 64-bit mode. Double clicking will run in x64 mode however you should also test 32-bit mode. You can do this by dropping your VBS on the wscript.exe app you will find in SysWow64. Please try both modes and let us know that both are working.
Set d = CreateObject("ABCpdf13.Doc")
d.FontSize = 96
d.AddText "Hello World!"
d.Save "mydoc.pdf"
MsgBox "Finished"
If they are not working then under the ABCpdf menu item you will find ASP and COM documentation and a batch script for registering ABCpdf for use under COM. If you have run the installer and for some reason your COM interfaces are not working then re-running this batch script is the first thing you should do. Then test again.
If still things are not working please do a simple sanity check on the installation. Open PDFSettings and see it produces a sensible description for your trial license. PDFSettings loads up ABCpdf so if it works then this is a pretty good indication that the installation is good.
The batch script is just a simple wrapper for the Microsoft regasm .NET tool. The script is designed around registering the DLLs from a standard installation. While it may serve as a useful illustration of how to register a .NET assembly under COM, if there are any problems you should be looking at using the regasm tool directly. Open the script and look at it in Notepad to see how it works. It is pretty simple but you may find the Microsoft regasm documentation useful.
You are likely to need to run as Admin (right click and start your command prompt using Run as Admin). Similarly please bear in mind that there are both x86 and x64 versions of the tool so you will need to try both. Please do this.
If it is still not working then you first need to validate that the .NET side of things is working. Please download this simple "Hello World" .NET project. Copy the DLLs into the bin directory of the project. Uninstall ABCpdf to ensure that only those DLLs are used. Compile it up and. run it on a different machine. It should produce a PDF.
Then copy that project to your new machine. Run it. It should produce the same. That will demonstrate that there is no problem loading the ABCpdf DLLs or dependent DLLs. If there are problems then this would indicate generic issues related to your installation rather than anything specific to do with ASP or COM.
Then use regasm to register those same DLLs from the bin directory of that project. If there is a DLL load error then it relates to something outside ABCpdf.
If you need to track that down then you may get more details using the regasm verbose option. Alternatively you can use Process Monitor to check what files are being searched for and what appear to be missing.
The above should allow you to track down the problem. However please keep detailed notes for each of the points above so that in the unlikely event that you cannot track down the problem, you can tell us - exactly - what you've done and what the results were.
Please note that you do not really need the tlb which comes with ABCpdf .NET. We include it but regasm will generate it for you.
- I'm running a static security scan on ABCpdf and it's giving me a warning related to a call to CreateProcessWithLogonW. Do I need to worry?
-
Typically static scans look for calls to unusual functions and then flag them as suspicious.
Please see our security page for details of the problems with this type of approach, and the ways in which you should run any such scans.
The CreateProcessWithLogonW call is used for the creation of ABCGecko worker processes by TaskGarden - a .NET equivalent to .NET Enterprise Services. We use TaskGarden because although .NET Enterprise Services sounds like a .NET type of thing it is actually based on COM and
our experience is that clients find it difficult to configure.
The particular call relates to loading a worker process file for Gecko HTML conversion. If you wish to avoid this call just don’t use the Gecko engine in your code. If you use the Gecko engine you should note that there is validation done on the worker process file to ensure that it is correct.
In older versions of ABCpdf there are checks done to ensure that the engine is valid but these are based more around protecting against inadvertent mix ups in deployment rather than malicious insertion by a sophisticated enemy. In newer versions (ABCpdf 10.1.1.7 onwards) a more rigorous approach is taken - a hash of the file is calculated to ensure that it is the same as the one the product was built against.
While of course we would advise staying up to date, even in these older versions - dating back to 2017 - the protections are fairly solid. They could only really be leveraged in situations in which your systems had already been penetrated.
- How do I install and run ABCpdf on Azure?
-
You can find out about ABCpdf Azure deployment on our Azure page...
- "Unable to render HTML. ABCChrome has terminated unexpectedly. Failed to apply FireShield rules. Unable to create mutex. Windows error code 0x5. Error code 0x65." What does this mean?
-
FireShield is a security system that lets you dynamically assign file permissions at runtime, to ensure that your HTML engine only accesses the locations you want.
In order to function it has to have permission to create mutex objects. On some restricted permission systems - notably Classic ASP - these may not be available.
Ideally one would adjust permissions to allow FireShield to function. However if you are confident in your security setup you may prefer to disable FireShield instead.
doc.HtmlOptions.FireShieldEnabled = False ' VB under Classic ASP
doc.HtmlOptions.FireShield.Enabled = false; // C# under .NET
- ABCpdf takes is very slow on my non-internet connected computer. Looking at logs I see requests to 172.64.149.23 and 104.18.38.233. Are these facts connected?
-
The IP addresses you are seeing are associated with comodoca.com CRL and OCSP. So most likely these are related to certificate validation.
There are two sets of certificates. The first are on the ABCpdf assemblies. Those will get validated at the point that ABCpdf is loaded - typically at the point that the first Doc object is created or at a call to XSettings.InstallLicense.
If you are using the ABCChrome, ABCGecko or ABCWebKit HTML engines, there are certificate checks on those too. They will be validated at the point that AddImageUrl/Html is called. These are one time initialization checks, so after the first call, subsequent calls should be fast.
You need to establish the times for each of these events to determine if one or both of them is causing any slowdown. Most simply you can just step through your code on the destination computer seeing how long each call takes.
The .NET checks typically do not produce a delay. However if they do, you can change the way .NET operates using the .NET generatePublisherEvidence settings.
The HTML engine checks are more rigorous and so they will take some time before giving up on the online revocation check.
You can disable these checks using the ABCChromeDisableFileCheck, ABCGeckoDisableFileCheck or ABCWebKitDisableFileCheck low level overrides. These settings need to go into the registry or a config file. See documentation for details.
However please note that by doing this you are disabling a security measure which keeps you safe. As such you will need to take appropriate measures to safeguard the integrity of your installation.
If you do not do this, you invite the possibility of loading files which are wrong, producing crashes or unusual behavior. At worst the lack of checks could be used by a malicious agent as an attack vector.
- What does "Unable to initialize API::Hook for FireShield. Error code 0x65." mean?
-
This is an error stating that FireShield could not be started up correctly.
FireShield is a part of ABCpdf which protects you from unauthorized access to files and resources when performing HTML conversion.
The problem is related to an OS level issue introduced in the Windows 11 and Windows 2025 24H2 update. Updated systems report as version 10.0.26100 in the System Information Accessory.
The simplest solution is to upgrade to ABCpdf .NET Version 13.3 or later as this will resolve the issue.
Alternatively you can work around the issue by disabling FireShield.
doc.HtmlOptions.FireShield.Enabled = false;
If you do this please read the FireShield documentation to understand the implications.