Cannot print out XPS document - xps

I have a program that accepts parameter and generate XPS file.
However I've found that SOME file cannot be printed out with whether Windows XPS Viewer or Windows API to print it out.
When printing with XPS Viewer, it will prompt an error with "A printing error has occurred", "The XPS Viewer cannot print all pages of this document".
While printing with Windows Api Startxpsprintjob, it did returned a print job id but not print out.
For both the method above, it will produce the following sequence in windows print operation log:
As it only happens for some combination, I suspect that maybe it's related to XPS embedded font, however I can view all fonts correctly in the XPS viewer.
I have no idea on what can I do next, any help will be appreciate, thanks!

It's about XPS file contents and the way how Windows handles it. Some hints can be picked up here https://stackoverflow.com/a/6678902
You could try to print page by page (or even selection) and try to find out which contents cannot be printed.
What I experienced, the case when word document had been converted into XPS file, insertion of image with text made the problem, and inserted text box was the solution.
So, it can be anything. Good luck! :-)

Related

wkhtmltopdf generates from PDF format on Ubuntu without X Server

Is it possible to set format of PDF to generate in wkhtmltopdf?
From my PC wkhtmltopdf generates format "PDF-1.4"
But remote Ubuntu 14.04 server that is generating pdf with a 'virtual' X server using xvfb giving format PDF-0:
The only problem is opening generated pdf file in Chrome :)
Chrome cannot open PDF-0.
Thanks
It looks like the resulting PDF from xvfb might not be 100% correct. There are some problems with the meta data. It's missing the creator for example. Also PDF-0 does not appear to be a valid PDF version. There might be other problems with the document. This would be a possible reason why the generated file does not appear in Chrome.
A good way to examine the document would be using Acrobat's preflight tool. It will inspect the document for potential problems, and that could give provide a clue on what's going on. The tool is located under "Print Production" in Acrobat. The profile to run is called "Report PDF syntax issues". I'm sure there are other tools out there that can also explain what is wrong with the document.
This section should provide a resolution to the problem. As mentioned in the comments below, updating the QT version from 4.8.6 to something newer should resolve the issue. The working setup appears to be running 5.3.2, while the non working one is under QT 4.8.6.
May i recommend phantomjs as an alternative (headless tool, no server x needed at all) to xkhtmltopdf.
HTML to PDF rendering is very straight forward (e.g. http://phantomjs.org/screen-capture.html )
Bounty answer:
Apparently QT 4 and QT 5 behave differently when printing to a PDF. Thus, your problem can be solved by upgrading the QT libs on your server.
You may consider filing a bug against wkhtmltopdf since your described behavior obviously renders it incompatible with QT 4.
See also original comment here.

Swiffy External Text Loading

I have a simple flash activity that loads its text from an external file called QA.txt using the URLLoader function. I wanted to convert this file to html5 using Google Swiffy, which I have done, expect it doesn't seem to be loading the QA.txt file anymore. I believe it says this functionality is supported on their main website, so I'm wondering why it might not be working.
Any help would be greatly appreciated!
Swiffy does indeed support URLLoader!
I think your problem is this: if you open up your converted html file in your browser and also open up the developer tools console (try hitting F12), you should see an error message along the lines of:
XMLHttpRequest cannot load .../...myText.txt. Cross origin requests are only supported for HTTP.
Because you've open up the converted html page by itself, your browser isn't letting the code in that page fetch any other files, because they aren't being treated as coming from the same origin (even though they might well be sitting in the same directory) due to the same origin policy.
To get around this, you should access the swiffy html by fetching it through a local web server, something like apache (php) or node (javascript).
(It should also be working normally if you upload it onto the internet.)

Programmatically render a LocalReport to XPS

I'm trying to render a LocalReport to a XPS file, so I can print them from a Windows Service using the XPS Print API, as it is shown in this article.
The problem I find is that I cannot render a local report directly to XPS. Maybe I can render it to an image stream, and then embed that image into a manually created XPS, but I don't like that solution too much.
I would really appreciate any advise about rendering a LocalReport to XPS.
Unfortunately, it won't be easy. Except that it is.
First off, everything has to happen within an STA thread. So you start out with threading issues.
Next, XPS documents are deeply intertwined with WPF. XPS documents expose their content as FixedDocumentSequences, which are DependencyObjects. That's all WPF. Your LocalReport is not WPF, its a Forms-based component.
Your only option is to render the report to some kind of format that can be converted to a WPF representation by some kind of parsing and rendering process you code. This might be as simple as creating images from the report, or as hard as writing an XSLX converter.
But why even bother with this in the first place? The documentation for LocalReport shows how you can print the report without dealing with XPS print paths.

MS-Access 2007 Runtime SendObject Crash

I have programmed an Access Database program using Access 2007. I have a button that points to the event: DoCmd.SendObject acSendReport to have it email a PDF report (acFormatPDF). Everything works fine in the normal Access 2007 program, but when a user opens the program with Access 2007 Runtime, when clicking on this button it goes through the normal steps (notifying Outlook, waiting for Allow/Deny clearance), and then after you click Allow, the program crashes with a Runtime Error.
Does anybody know what is going on here? Is this a normal error with Access Runtime? I have tried other file formats (RTF and XLS) instead of PDF, but it seems to be the SendObject command that is crashing the Runtime Environment?
Clarification: Access Runtime does not output an error code upon this crash. Just a window stating a "runtime error has occurred".
It seems that the runtime license doesn't not cover the PDF converter. However, this article:
http://blogs.msdn.com/access/archive/2007/08/23/pdf-xps-now-supported-in-access-runtime.aspx
purportedly explains how to chain the PDF converter installer with your runtime installer so that it will be part of the runtime installation. Unfortunately, subsequent discussion on that page shows that PDF output didn't actually work with the runtime. The SP2 for the runtine purportedly also fixes the problem:
http://blogs.msdn.com/access/archive/2009/04/29/access-2007-and-runtime-sp2-now-available.aspx
but some commenters there report nonspecific PDF issues. So you might want to check if you've got SP2 of the runtime and see if you can then use the PDF converter.
Sorry not to be of more help here, but it really does look like you're encountering a widely-experienced problem.
I have discovered another issue that I had in the code. On top of the PDF issue answered by Mr. Fenton, I had an issue with the multiple email addresses in the code. I had listed multiple email addresses in the CC portion of the code. If I just list 1 email address, it works.
So now I just have to figure out how to send the email to multiple address and all should be well.

AS3 XML and Line Spacing Problem

Background: I'm building this photo gallery in AS3, when user clicks a thumbnail is displays text gathered from an XML file.
Problem Description: Everything runs wonderful on my local machine, but when I upload the files to the server and preview the site from the server, the line spacing on the description text is way different than when I preview the site local.
Below see two images so you can see the difference
Correct one (Preview from Local Machine)
correct Spacing http://www.olemedia.net/lineSpacing1.jpg
Incorrect One (From the Browser)
incorrect Spacing http://www.olemedia.net/lineSpacing2.jpg
Solution: Any suggestions?
It is indeed a line break issue that depends on what platform you're on, or rather. how the xml document was saved. Line breaks on windows are \r\n (Carriage Return + Line Feed). if I recall correctly. Flash player interprets both as a newline. I usually do something like this:
var text:String = xml.whatever.text().split("\r").join("");
That will get rid of all the \r's (if they're there) and leave only \n's.
Your images don't show up (I think there's a minimum reputation required to post images), but based on the description I'm going to guess that your local machine is windows and the server is unix. It's probably a problem with line-endings being \r\n instead of \n, most editors can do this conversion for you, or there are various tools to convert.
If this isn't right, link to the images so that we can see what's happening.
I found the solution. Is a bug with Flash CS4 (mac and windows).
I place my flash file to a Linux server and also to a windows server. Definitely windows server was the problem. I'm not sure why but it is. I'm working from mac, and possibly this effect also on the type of server you publish you swf files.
Thanks everybody, much appreciate your time and dedication.