ABCPDF6 issue: "HTML render is blank" but web page output is fine - abcpdf

Like the title says, we are using ABCPdf6 to render PDFs from XSLT. Everything was working fine, but now we are getting an error that states "HTML render is blank". Using a browser (tested on IE/Firefox/Chrome) I am able to browse to the generated HTML (formatted XSL) and it displays perfectly fine in the browser. ABCPDF6 is not able to convert the file. I have tried giving control to the page that outputs the XSL, but I am still getting this error.
Does anyone have experience with ABCPdf and have encountered this before? The code was working fine before without a problem, and another page that uses the exact same generating code (even pointing to the same placeholder page that spits out the HTML!) is working fine.

I know what the problem was in my case now.
When i ran Windows update on my 2008 server, Internet Explorer 9 was installed.
IE 9 has a different way of rendering HTML which brakes abcPDF.
Updating to the latest version (8) solved all my problems. In this version you can also try another HTML engine called Gecko.
Even though you have resolved your problem, if anyone else gets this error, I would suggest that you install the trial version and try this out with the latest version.

I had same error on windows 7 machine with AbcPdf4.0. During MS updates IE8 was upgraded to IE10. Issue got fixed by uninstalling IE10.
Note: Abcpdf4.0 does not work with IE9 onwards. Either upgrade Abcpdf or uninstall latest IE.

I had a similar issue this morning with AbcPdf9. I added code to test the engine types and GECKO worked, then I swapped it back to MSHTML, and it still worked. So it was a temporary issue.
This is how you specify the engine type:
using (var document = new Doc())
{
document.HtmlOptions.Engine = EngineType.Gecko;
...
...
}
This code calls the method that converts the html to PDF, but calls it twice if necessary, since it will only fail once:
try
{
return GeneratePdfFromHtml(html, width, EngineType.MSHtml);
}
catch (Exception ex)
{
/* detect this known issue, swapping the rendering engine once seems to fix it */
if (ex.Message.ToUpper().Contains("BLANK"))
{
return GeneratePdfFromHtml(html, width, EngineType.Gecko);
}
throw;
}
Then you can add a parameter to the method that does the conversion:
public byte[] GeneratePdfFromHtml(string html, int width, EngineType engineType)
{
if (string.IsNullOrWhiteSpace(html)) throw new ArgumentNullException("html");
if (width < 100) throw new ArgumentOutOfRangeException("width");
try
{
using (var document = new Doc())
{
document.HtmlOptions.Engine = engineType;
...
...
If you have a suggestion or different solution, please leave a comment.

In regedit use the following steps
1)HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node
2)Create a key DWORD 32 Bit
3) Rename it "w3wp.exe"
4) Set Value Date = 1

Related

CKEditor 4.7.3 not utilizing custom config file any more

I am hoping someone can help me. I have been using CKEditor for years on my production site, ever since FCKEditor, and it has been working very well until recently. I have customized my toolbar and added custom addons and customized the filebrowser and they have been working for a long time. My config file is sitting in a subdirectory but CKEditor just does not want to show the customizations for me, it just shows the FULL toolbar with standard colors etc. Has anyone else noticed this behavior? Is there some fix I cannot seem to find for this? My CKEditor call is below. The odd thing is my dev server and my dev box have no issues with this and ckeditor works just like it should. Any help would be greatly appreciated!
CKEDITOR.replace('ctl00_ContentPlaceHolder1_fckTemplateEditor', {
customConfig: 'ckeditor/myconfig.js'
, filebrowserBrowseUrl: 'ckeditor/filemanager.aspx?window=' + window.name,
filebrowserImageBrowseUrl: 'ckeditor/filemanager.aspx?window=' + window.name,
filebrowserWindowWidth: '780',
filebrowserWindowHeight: '650'
}, {
removePlugins: 'elementspath',
extraPlugins: 'uicolor',
height: '800px',
});
CKEDITOR.config.height = 450;
Ok after trying everything I could find, I figured it out. It seemed it was attaching to the control prior to my replace call so it was giving me an already attached error in the console, which I was not watching for. so I needed to destroy that attachment with the following code and it started to work again. There must be some issue with new browsers and how they work that is causing it to act up and just thought I would share what I found after a day of searching.
if (CKEDITOR.instances["ctl00_ContentPlaceHolder1_fckTemplateEditor"]) { // Check null
CKEDITOR.instances["ctl00_ContentPlaceHolder1_fckTemplateEditor"].destroy();
}
Thanks

Cordova AngularJS Windows 8 App Fails on ui-bootstrap Templates with "directive must have exactly one root element"

I am using Cordova 4.0.0 with AngularJS 1.2.26, Angular-Bootstrap 0.11.2, and UI Router 0.2.11 to create apps for Android and Windows (8.0 and 8.1). I am having an issue only when running the application in Windows with ui-bootstrap templates. The same error keeps popping up for standard templates for typeahead, datepicker, and the modal dialog, "Template for directive { whatever } must have exactly one root element."
Looking at the DOM inspector within Visual Studio, it seems that every node that has the ui-view directive is getting populated with its own set of head and body tags (which wraps around the template in question). I'm guessing that this is the issue, but am having trouble pinning down where these extra nodes are being inserted, and thus, having trouble proving out the theory.
The same code works as desired in the latest Chrome, FireFox, and IE desktop browsers, as well as within Android.
Does anyone have any insight on this behavior? It might also be worthwhile to note that ngCsp is being used to alleviate dyanmic content insertion restrictions on Metro applications.
Thanks in advance!
I found that the problem was in the shim winstore-jscompat.js
The method used to add the new tags has a bug.
My version of that method is:
cleansePropertySetter("innerHTML", function (propertyDescriptor, target, elements) {
empty(target);
for (var elementIndex = 0, elementsLength = elements.length; elementIndex < elementsLength; elementIndex++) {
if (elements[elementIndex].nodeName == 'BODY') {
for (var childIndex = 0, amountOfChildren = elements[elementIndex].childNodes.length; childIndex < amountOfChildren; childIndex++) {
target.appendChild(elements[elementIndex].childNodes[0]);
}
}
}
});
This did the trick for me. I have not yet tested all variations of directives.
The fix above didn't work for me, but I found a Fork that fixes the issue:
https://github.com/ClemMakesApps/winstore-jscompat/blob/master/winstore-jscompat.js
Note that this will probably be pulled into the main project at some point so this issue should go away "soon".
Also here is the original issue:
https://github.com/MSOpenTech/winstore-jscompat/issues/8

Selenium IDE datadrivenv0.2 issue with Firefox 20.0

I have just updated my firefox to v 20.0. Whenever I open Selenium IDE in firefox , it show a popup error .
Failed to load user-extensions.js file=[PATH to file ...]datadriven_v0.2/datadriven.js lineNumber=37 error=ReferenceError:XML is not defined.
The reported line in the file is sth like this :
XML.serialize = function(node) {
if (typeof XMLSerializer != "undefined")
return (new XMLSerializer()).serializeToString(node) ;
else if (node.xml) return node.xml;
else throw "XML.serialize is not supported or can't serialize " + node;
}
I do not know any thing specific to selenium IDE ,if XML is part of Selenium IDE or firefox . However, it seems latest updates to Firefox has sth to do.
I ll appreciate if someone help me fix this issue.
You can fix this by declaring the XML-Object in datadriven.js before it is called.
var XML = {};
XML.serialize = function(node) {
if (typeof XMLSerializer != "undefined")
return (new XMLSerializer()).serializeToString(node) ;
else if (node.xml) return node.xml;
else throw "XML.serialize is not supported or can't serialize " + node;
}
I don't know if this has any side effects, but for me it works.
Sven's idea worked perfectly for me. I added the command
var XML = {};
to the beginning of my user-extensions.js file, closed FF and Selenium, and restarted them. They've been working perfectly since then. I'm up to FF v21.0 with no problems.
Thanks Sven!
I am posting this for anyone using sel-blocks; the above solutions don't seem to work, since sel-blocks is an add-on and not a user-extension. However, there is still a solution. I added the line suggested above:
var XML = {};
to this file instead:
xmlextras.js
This file can be found in (selenium extension folder)/chrome/content/selenium-core/scripts
If you aren't sure how to get to your selenium extension folder, roughly here is how:
C:\Users(your username)\AppData\Roaming\Mozilla\Firefox\Profiles(your firefox profile)\extensions{a6fd85ed-e919-4a43-a5af-8da18bda539f}
I apologize if I'm not using the correct format for posting an answer or anything, but I just want to make sure that anyone searching for the answer I was looking for is able to find something.
From checking the Selenium website, the latest version of SIDE only supports up to Firefox version 17.
https://code.google.com/p/selenium/wiki/SeIDEReleaseNotes

Watin 2.1 error with Firefox 3.6 ContainsText and jssh

I have had problems using Firefox with Watin 2.0 and the recent 2.1 release.
FireFox: 3.6.17
Watin: 2.1.0.1196
Gallio / mbUnit: 3.2.601
Windows Server 2008 32 bit
.NET 4.0 assemblies
Visual Studio 2010
I went over these instructions repeatedly:
http://watin.org/documentation/setting-up-firefox/
I went to Firefox, File->Open, navigated to the file: jssh-3.6-WINNT.xpi
Installed the XPI in Firefox without any problem.
A few things do work fine in FF with Watin. Finding text fields, TypeText, Click, all that works. But this line of code blows up:
Assert.IsTrue(theBrowser.ContainsText(validationText), "Listing '{0}' was not found in the results.", validationText);
See below for the error. Any idea what I did wrong?
WatiN.Core.Native.Mozilla.FireFoxException: Error sending last message to jssh server: SyntaxError: missing ) after argument list
C:\QEDev\tools\WatiN\source\src\Core\Native\Mozilla\FireFoxClientPort.cs(422,0): at WatiN.Core.Native.Mozilla.FireFoxClientPort.CheckForError(String response)
Another user here on StackOverflow answered this question in a separate thread. Here is one workaround:
Sub-class based off of Watin's Firefox class
Override the ContainsText method
Use the HTML Agility Pack to load the document and call the Contains method.
This seemed to work fine for a while. On other computers I saw the same JSSH error as before.
public override bool ContainsText(string text)
{
WaitForComplete();
var htmldoc = new HtmlDocument();
htmldoc.LoadHtml(Html);
bool result = htmldoc.DocumentNode.InnerText.Contains(text);
return result;
}

Watin - IE8 hangs on FileUpload.Set

Whenever I call FileUpload.Set, IE8 will open up the file browser window and just sit there without typing any text. This is on Windows XP and it used to work just fine until I upgraded from Ie7 to IE8. Anyone else run into this?
Turns out this line in the WatiN source was the problem:
if (Process.GetProcessById(window.ProcessID).ProcessName != "iexplore") return;
For some reason, the iexplore process on this machine appears as "IEXPLORE", in all caps. Adding a .ToLower() to the process name fixes the problem.
edit: looks like this bug has already been reported.
Because of the way WatiN looks for the dialog box (by style number), it's understandable that IE8 would be broken in versions less than 2.0. You may want to try it with the 2.0 beta.
Alternatively, you can dive the style numbers on the FileUpload DialogHandler and add the style numbers for IE7 and 8 (96CC20C4 and 96CC02C4).
I'd like to post an update for this problem since it came up again in Win7 OS.
If you have the same problem in the latest WatiN release you can override the function CanHandleDialog in the FileUploadDialogHandler class:
public override bool CanHandleDialog(Window window, System.IntPtr mainWindowHwnd)
{
return true;
}
It's not a clean solution but it is the simple and works.

Resources