- 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. You will need MS Office 2007, 2010 or 2013 installed.
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 6.23 and Section 6.27 respectively.
- Can I use ABCpdf from Visual Basic?
-
Yes. All the example code will be exactly the same but you'll need to replace ASP specific code like Server.CreateObject with generic code like CreateObject.
- 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 don't 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're not sure what these are then please don't 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.
- Why doesn't AddImage work with my GIF images?
-
You can pass AddImage a path to a JPEG, TIFF or EMF file. This inserts the raw compressed data into your PDF document. Other image types (e.g. GIF) cannot be inserted direct - they must be drawn into an Image object and then the Image object can be added to the PDF document. There are examples in the ABCpdf documentation.
- My code works on my dev 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("ABCpdf11.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're 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're experiencing difficulties converting HTML we recommend updating to the latest release on our downloads page before continuing.
If you're using ABCpdf's (default) MSHTML engine it needs a compatible Internet Explorer version on the same system. Please see the feature chart for details.
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.
Windows Server 2003 defaults to an Internet Explorer Security policy which may interfere with HTML rendering. You may have to modify or disable the policy to allow access to the pages you want to render. If you wish to remove the security component you can do so using the "Windows Components" section of the "Add & Remove Programs" control panel.
In Windows Server 2008 up, choose "Server Manager", then "Security Information", then "IE ESC (Enhanced Security Configuration)". You can then configure access separately for Administrators and Users.
If this doesn't 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 IE while logged on as Administrator (on the system where ABCpdf runs). Make sure IE doesn't 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're 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.
- If you see the following error:
"Unable to render HTML. Failed to configure IE 9 or above for the MSHtml engine: Access denied while writing to the registry.
For IIS applications, please enable "Load User Profile" or consult MSHtmlBootstrap in the documentation. Alternatively, you can configure this registry setting manually: 1. Create registry key "Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_IVIEWOBJECTDRAW_DMLT9_WITH_GDI" (which have to be under the Wow6432Node key if the running process is 32-bit on an x64 system; the current process is 64-bit). 2. In the created key, create a DWORD value named "w3wp.exe". 3. Set the DWORD's value to 1." then create the appropriate registry key.
... then do what it says.
- 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.
- 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're 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 doesn't 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're 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 IE on the same machine as you're running ABCpdf on. You should see the same content in IE 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're 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 IE. 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 15 seconds. If it doesn't it will time out. So... hardwire your URL into the code so you're sure it's correct. Open the same URL in IE. How long is your page taking to load when you view it in IE?
Assuming it takes longer than 15 seconds you need to adjust the timeout - see the HtmlOptions.Timeout property.
Don't 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.
- I'm getting a "Windows error 193. %1 is not a valid Win32 application" error.
-
This is a permissions issue related to the creation of MSHTML objects. Please start by checking the "I'm having problems with Security." section of this page.
Sometimes this permissions issue can have a base cause in an old or inconsistent installation of MSHTML. If this is the case then updating IE and restarting may well resolve the issue.
As with all permissions changes take great care. It is vital you ensure you know how to back these changes out should you decide that they are inappropriate. If you are unsure then please do not make any changes.
Open the Component Services control panel. Right click on the 'My Computer' icon to get up generic COM/DCOM permissions. Check the Launch and Access permissions. If your IIS user (typically ASPNET or IUSR_MACHINENAME) does not have Launch and Access permissions it may be denied permissions to create or use MSHTML objects.
The issue may be related to the fact that your IIS user doesn't have "log in a batch job" permissions. Try assigning the permission to that user.
Restart your computer and try your code again.
- Why doesn't my font 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 won't 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.
- Why don't my documents measure up when I print them?
-
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 don't 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 can't see a solution send us a simple example of a PDF which prints correctly and one which doesn't. 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("ABCpdf9.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're really not sure then use a utility like IEWatch to check the content headers being returned. If you see gzip then you're seeing compressed content. (If you're 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're using IIS 7.5 or higher, and ASP Classic - but not ASP.NET - we've see 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 doesn't 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.
So you need to provide your stylesheet and image links as absolute references. Or you may be able to use the HTML BASE element to specify an appropriate base location. Or you can save your HTML to file in an appropriate location and then use AddImageUrl.
- 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 doesn't 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're 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.
- How do I use ABCpdf from WebMatrix?
-
The way in which Assemblies are linked from a particular development environment is very much dependent on the development environment. So for best practice you should consult the documentation for your chosen environment.
However you might like to use a register tag to link to the assembly and import the namespace:
<%@ Register TagPrefix="pdf" Namespace="WebSupergoo.ABCpdf6"
Assembly="ABCpdf, Version=8.0.0.5, Culture=neutral, PublicKeyToken=a7a0b3f5184f2169" %>
Obviously you'll need to modify the version and possibly the key to match the assembly you're using.
- Why is Acrobat telling me my fields are malformed after I use ABCpdf to delete them?
-
If you create forms using Adobe Designer (which comes with Acrobat 7) it will make use of some new field references which were not used in version 6.
If fields are deleted and the field references are left intact then Acrobat may complain that the fields are invalid.
To solve the problem delete the AcroForm after deleting the fields. For example:
theDoc.SetInfo theDoc.Root, "/AcroForm:Del", ""
Alternatively if you are simply setting field values then you may be able to achieve what you want by deleting the XFA elements:
theDoc.SetInfo theDoc.Root, "/AcroForm/XFA:Del", ""
- 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'm 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...
- Why might I see "Exception of type 'System.ExecutionEngineException' was thrown."?
-
When certain security attributes are applied to an assembly this may crash the CLR (Common Language Runtime) under .NET 3.5 SP1. The issue is intermittent and the periodicity is related to the environment. We have an open Tech Support incident with Microsoft relating to this. They have confirmed the bug but they have not told us when it will be fixed.
We have worked around this issue in ABCpdf version 7 (minor version 7010).
An alternative would be to remove SP1 and wait for a fix from Microsoft.
- Why am I seeing different PDF output after installing/updating IE8 on my server? (pre-ABCpdf7012)
-
ABCpdf uses the MSHTML component (installed with Internet Explorer) when rendering HTML to PDF.
Although we've always attempted to maintain as much compatibility as possible between ABCpdf and different versions of IE, we've had to introduce changes in ABCpdf version 7 (minor version 7012) in order to interoperate with IE8 when rendering some types of HTML content.
Otherwise, if you come across an issue using IE8 with older versions of ABCpdf you would need to continue to use IE7.
ABCpdf 8 offers a choice between using the MSHTML and Gecko rendering engines.
- I see the exception "Unable to load DLL 'ABCpdf9-64.dll': The specified module could not be found.", or "Unable to load DLL 'ABCpdf9-32.dll': The specified module could not be found.", (or "Unable to load DLL 'ABCpdf8-64.dll': The specified module could not be found.", or "Unable to load DLL 'ABCpdf8-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 "ABCpdf9-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. 9.1.1.9) of the ABCpdf.dll and ABCpdf9-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'm 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.
- Why is Visual Studio 2010 telling me I am referencing .NET 3.0?
-
ABCpdf links into whatever functionality is available in .NET at runtime. It links into .NET 3.0 but will run quite happily against .NET 2.0 with certain elements of functionality disabled.
Unfortunately the ability to do this, available in Visual Studio 2005 and 2008, has been removed in Visual Studio 2010. So Visual Studio 2010 will insist that you target .NET 3.0 even though ABCpdf doesn't actually require it. If this happens you will see errors like this when you try to build:
Compile complete -- 9 errors, 0 warnings
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "ABCpdf" could not be resolved because it has an indirect dependency on the framework assembly "WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "ABCpdf" or retarget your application to a framework version which contains "WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "ABCpdf" could not be resolved because it has an indirect dependency on the framework assembly "PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "ABCpdf" or retarget your application to a framework version which contains "PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "ABCpdf" could not be resolved because it has an indirect dependency on the framework assembly "ReachFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "ABCpdf" or retarget your application to a framework version which contains "ReachFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "ABCpdf" could not be resolved because it has an indirect dependency on the framework assembly "PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "ABCpdf" or retarget your application to a framework version which contains "PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "ABCpdf" could not be resolved because it has an indirect dependency on the framework assembly "UIAutomationProvider, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "ABCpdf" or retarget your application to a framework version which contains "UIAutomationProvider, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "ABCpdf" could not be resolved because it has an indirect dependency on the framework assembly "UIAutomationTypes, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "ABCpdf" or retarget your application to a framework version which contains "UIAutomationTypes, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "ABCpdf" could not be resolved because it has an indirect dependency on the framework assembly "System.Printing, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "ABCpdf" or retarget your application to a framework version which contains "System.Printing, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
Obviously the simplest solution is to change your project target to .NET 3.0. However for those that are unable to do this you can change the project settings manually to enable linking against .NET 2.0.
Suppose you have a project called 'MyProject'. In your Visual Studio 2010 solution:
- Click on the Reference to ABCpdf
- In the Properties window change the 'Specific Version' property to true
- Right click on the project that references ABCpdf and select 'Unload Project'
- Right click on it and select 'Edit MyProject.csproj'
- Find the reference to ABCpdf (which will look something like this)
<Reference Include="ABCpdf, Version=8.0.0.5, Culture=neutral, PublicKeyToken=a7a0b3f5184f2169, processorArchitecture=MSIL" />
- Add in a <SpecificVersion> tag (so it will look something like this)
<Reference Include="ABCpdf, Version=8.0.0.5, Culture=neutral, PublicKeyToken=a7a0b3f5184f2169, processorArchitecture=MSIL">
<SpecificVersion>true</SpecificVersion>
</Reference>
- Save and close the XML file MyProject.csproj
- Right click on the project and select 'Reload project'
- Compile and run
- Converting HTML with IE9 installed, I see the exception: 'ABCpdf could not initiate MSHtml engine for this version of Internet Explorer installed.'
-
Using IE9 on the same system as older ABCpdf versions may cause this error message.
ABCpdf version 8.1 and later are fully compatible with IE9 and also provide a Gecko-based HTML engine.
When converting HTML to PDF, ABCpdf uses the MSHTML component installed with Internet Explorer as the first stage of the process.
The issue when using older ABCpdf versions is related to a set of problems Microsoft introduced in IE9.
We (and other developers) reported these issues to Microsoft in September 2010 but unfortunately they have not been fixed.
Unfortunately with the official release of IE9 Microsoft released new documentation which says the IHTMLElementRender::DrawToDC function that was required has been deprecated.
This is especially unfortunate given that there is no replacement for this function.
Given that Microsoft appears to be unwilling to support these interfaces we would strongly recommend that on new deployments you consider a move to the new Gecko-based HTML engine available in ABCpdf 8.
It is just one line of code to select the Gecko rendering engine (see the Doc.HtmlOptions.Engine property).
- How do I make my eForm fields savable using Acrobat Reader?
-
Acrobat Reader XI provides features to save eForms out of the box. Provided your clients are using this version of Acrobat they will be able to fill in and save standard PDF forms. The only problem you may have relates to older versions of Acrobat Reader which did not have this feature.
In Acrobat X and earlier, saving the contents of forms was something which Adobe regarded as an Acrobat Pro feature. However it was a key feature present in other rivals to PDF. As such Adobe allowed PDF documents to be created which contained special flags which enabled certain Acrobat Pro features in the free Acrobat Reader. Features like filling in and saving forms.
Adobe tightly restricted the way in which these documents could be created. Specifically these documents contained a signature based on a certificate issued by Adobe. Without such a certificate you could not create or modify these kinds of documents. Adobe are not generally issuing certificates to allow this type of signature to be created. We believe the only company outside Adobe to have one is SAP.
It is possible to create something similar to a form which is savable using older versions of Acrobat Reader. This is because Acrobat Reader allows you to save changes to annotations as long as they are not part of an eForm. So by removing the form fields from the eForm you can be left with a collection of savable annotations. From a technical point of view the document is no longer a form but from a users point of view it may look like one.
doc.SetInfo(doc.Root, "/Perms:Del", ""); // make sure you have rights to do this
doc.SetInfo(doc.Root, "/AcroForm:Del", "");
Page[] pages = doc.ObjectSoup.Catalog.Pages.GetPageArray();
foreach (Page page in pages) {
Annotation[] annots = page.GetAnnotations();
foreach (Annotation annot in annots) {
StringAtom da = DictAtom.GetItem(annot.Atom, "DA") as StringAtom;
if (da == null) continue;
string ap = da.Text;
if (!ap.Contains(" 0 Tf")) continue;
double fontSize = annot.Rect.Height * 0.8;
da.Text = ap.Replace(" 0 Tf", String.Format(" {0:0.##} Tf", fontSize));
}
}
So why don't we have this as a feature in ABCpdf? Well Adobe have some of the best software engineers on the planet so it would seem to us that the fact that this feature exists means that it is intentional. It would seem inconceivable that this is an oversight. On the other hand the legal agreement for Acrobat Reader would appear to prohibit it being used for saving forms. But then this is not a PDF form. But then it might look like a form to an end user. EU law would appear to make it impossible to prohibit this type of operation. But not everyone is in the EU. There are a whole host of issues like this that are confusingly conflicted.
As such we do not feel that we want to make a judgment here. You need to look at the above code carefully and consider it in the context of the Adobe PDF Specification and the EULA for the version of Acrobat Reader you are targeting. At that point you can make an appropriate and informed decision based on your own use, position and legal advice.
- 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 isn't my COM or Classic ASP installation 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("ABCpdf11.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.
- What does this error mean?
ABCpdf error '80131600'
Failed to add HTML: RPC to Gecko engine process failed. Exception was thrown in another thread: The directory name is invalid.
-
This error could occur under some circumstances in earlier versions of ABCpdf Version 10. The solution is to upgrade to the current release.
- I'm running a static security scan on ABCpdf and it's giving me a warning about a call to related to a call to CreateProcessWithLogonW. Do I need to worry?
-
We are somewhat skeptical about the value of this type of static scan. Typically static scans look for calls to unusual functions and then flag them as suspicious. Yet it is actually common calls that are the most worrisome. Calls to read files and transfer data over the internet are subject to massive misuse, yet such calls are part and parcel of any non-trivial service.
To take an analogy, static scans look for people holding knives. However the significance of someone found holding a knife in a kitchen and that same person holding a knife in a subway is extremely different. This is what they miss and it is why they are misleading. By flagging calls to unusual functions you simply flag calls to unusual functions.
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.
However, our feeling is, in both older and newer versions, in order to insert a Trojan horse, attackers would already need level of access to your systems which would have compromised them so severely that they would be effectively wide open.
At this point there would be much easier avenues open to your attacker.
- I'm seeing occasional mysterious errors in MSHTML HTML conversion. These seem to be associated with events in the Application Event Log stating "Post operation taking an excessive time". What is causing this?
-
This is typically associated with Anti Virus (AV) apps intercepting HTML conversion and then failing or reducing the system to a crawl. This means that the results that ABCpdf is expecting, never return. Changing to a different AV app will normally solve the problem.
- When I use the ABCChrome HTML rendering engine I get "Unable to render HTML. ABCChrome has terminated unexpectedly. Status entrypoint not found.". What does this mean?
-
This error message relates to missing functions in Windows DLLs. It is what you will see if the machine you are running on is not sufficiently up-to-date.
The ABChrome HTML rendering engine requires Windows 2008 R2 / Windows 7 or later. It runs only on x64 systems.
The standard scenario associated with this type of message is related to deployment. Typically people develop on an up-to-date version of Windows. However then they may try deploying to an older one such as Windows 2008, at which point the issue would occur.
- I have a site running under Classic ASP. Around the 10th July 2018 I started getting an error "ActiveX component can't create object". Why?
-
Microsoft security update CVE-2018-8202 describes a situation in which,
"A local user can run a specially crafted application to exploit a flaw in the activation of COM objects and gain elevated privileges"
To be more specific,
An "elevation of privilege" vulnerability exists in .NET Framework that could allow an attacker to elevate their user rights level. To exploit the vulnerability, an attacker would first have to access the local computer, and then run a malicious program. This update addresses the vulnerability by correcting how .NET Framework enables COM objects.
Unfortunately the fix for this - released around the 10th July 2018 - has had the side effect of disabling calls to create objects under Classic ASP.
Our products use the standard methods that are built into .NET - ComVisible attributes and regasm.exe. So there is nothing unusual in our implementation and indeed we suspect this is affecting all .NET classes that expose COM interfaces.
The error reported is "ActiveX component can't create object" under Classic ASP at the call to CreateObject. So typically at the following point,
Set theDoc = Server.CreateObject("ABCpdf11.Doc")
This security update is contained a number of system updates including KB4338417, KB4340558, KB4338420 and KB4340559.
Backing out the update is one way to resolve the issue. Though without the update the system will remain vulnerable - you would need to establish if this is likely to be acceptable.
Alternatively you may wish to align your IIS and Web Site users which should also resolve the issue.
Classic ASP generally runs in the DefaultAppPool. The Identity setting for the pool should be ApplicationPooldentity. Assuming this is the case you just need to go to IIS and select your Web Site. Double click the "Authentication" icon. Right click on the "Anonymous Authentication" setting and select 'Edit'. Choose the "Application pool identity" radio button.
- The ABCGecko HTML engine is returning messages like "1534937003936 addons.manager ERROR startup failed: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE)..."
-
Yes ABCGecko can return cryptic messages like the following:
1534937003936 addons.manager ERROR startup failed: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIPrefBranch.setCharPref]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: resource://gre/modules/AddonManager.jsm :: AMI_startup :: line 733" data: no] Stack trace: AMI_startup()@resource://gre/modules/AddonManager.jsm:733 < AMP_startup()@resource://gre/modules/AddonManager.jsm:2468 < AMC_observe()@addonManager.js:55 <
Sometimes these messages can be displayed in hex format in which case you will see something like this:
[SerializationException: The input stream is not a valid binary format. The starting contents (in bytes) are: 31-35-33-35-31-34-35-31-37-38-30-30-34-09-61-64-64 ...]
These types of error are caused by a failure of communication between ABCpdf .NET and ABCGecko.
Typically ABCpdf .NET and ABCGecko communicate via standard output. However under some circumstances it appears that other applications can steal standard output or redirect the standard error stream through to standard output. This destroys communication between ABCpdf .NET and ABCGecko.
This issue is most common on Azure and it is our suspicion that Docker may be the cause of this problem. However it may be that there is more than one cause.
The solution here is to use a different interprocess communication mechanism - named pipes are a good alternative.
You can specify this using the setting IPCTransport in your app.config or web.config.
If you are using the registry key you should use the value 1 as detailed in the documentation.
For the web.config syntax please refer to XSettings.SetConfigSection in the documentation.