PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Printing via a PostScript printer driver

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
dsmeltz



Joined: 24 Jan 2008
Posts: 13

PostPosted: Fri Mar 14, 2008 8:23 pm    Post subject: Printing via a PostScript printer driver Reply with quote

We can not print a PDFSharp generated PDF to a printer using a PostScript printer driver. If we use a PCL printer driver then the PDF is printed, but when trying to use a PostScript driver, the printer is unable to print the PDF. Any ideas or suggestions on where to look in the PDFSharp code to attempt to fix this problem are greatly appreciated.

I know, 'Why not just use the PCL driver?' When you have a customer that doesn't want to change their printer driver you have to try and come up with another solution.
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Mon Mar 17, 2008 10:13 am    Post subject: Re: Printing via a PostScript printer driver Reply with quote

dsmeltz wrote:
We can not print a PDFSharp generated PDF to a printer using a PostScript printer driver.

Does this happen will all PDF files created with PDFsharp or only with some?
Does this happen with all PostScript printer drivers or only with some?

What is happening when printing? Do you get empty pages, error messages, or no pages at all? Do you get errors while spooling the document?
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
dsmeltz



Joined: 24 Jan 2008
Posts: 13

PostPosted: Mon Mar 17, 2008 3:20 pm    Post subject: Reply with quote

This is happening for all files created with PDFSharp and printed via a PostScript printer driver.

The problem can also be exhibited sometimes when you try to print from Adobe via a PostScript driver. Adobe generates a 'The document could not be printed' error.

We have seen this happen with at least three different PostScript drivers. They are Canon, Xerox and HP PostScript printer drivers. These are the only three printers we have available to test.

We always receive the first page. Most of the time we receive the second page, then it varies when you receive an error on the printer. Here are some examples of the printer errors from the Canon printer:
----------------------------
ERROR: invalidrestore
OFFENDING COMMAND: restore
STACK:

-savelevel-
39
212.64
----------------------------
ERROR: invalidrestore
OFFENDING COMMAND: restore
STACK:

-savelevel-
0
1.84126
2.72032
4.48654
4.48654
4.48654
4.48654
5.80127
-mark-
(Q21C1-3.)
----------------------------
ERROR: syntaxerror
OFFENDING COMMAND: (a list of binary characters)

STACK:

/;#################
true
true
false
----------------------------
ERROR: undefined
OFFENDING COMMAND: RBJOLB+Ar

STACK:
----------------------------


I have a file available for you to look at if you would like.
Back to top
View user's profile Send private message
dsmeltz



Joined: 24 Jan 2008
Posts: 13

PostPosted: Tue Mar 18, 2008 1:36 pm    Post subject: Reply with quote

Let me also add that we are concatenating PDF originated from different sources, which aren't PDFSharp. We are using PDFSharp for concatenation and bookmarking. We also add a page number on certain pages.

The original documents all print, without issue, via a PostScript print driver. It's only after they are concatenated and processed with PDFSharp that the PostScript printer driver problem is experienced.
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Tue Mar 18, 2008 2:01 pm    Post subject: Reply with quote

dsmeltz wrote:
Let me also add that we are concatenating PDF originated from different sources, which aren't PDFSharp.

Maybe the bug fix described here can help you.

Can you open the concatened PDFs with different Acrobat Reader versions without error messages? (please scroll through the entire document because errors occur only when pages are rendered)

The bug discussed in the other thread was only reported by older versions of Reader (I think I tried versions 5 and 6), where Acrobat 8 silently ignored the errors.

Which technique do you use to concatenate the files? (is your code based on one of the samples?)
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
dsmeltz



Joined: 24 Jan 2008
Posts: 13

PostPosted: Tue Mar 18, 2008 2:24 pm    Post subject: Reply with quote

I can successfully open and view all the pages of my test document in Acrobat Reader 6.

Here's how we are doing concatenation:

// Open the document to import pages from it.
using ( PdfDocument inputDocument = PdfReader.Open( tocItemInfo.FileName, PdfDocumentOpenMode.Import ) ) {
// Clear the bookmarks
if ( inputDocument.Outlines.HasOutline ) {
inputDocument.Outlines.Clear();
}

// Iterate pages
int count = inputDocument.PageCount;
for ( int idx = 0; idx < count; idx++ ) {
// Get the page from the external document...
PdfPage page = inputDocument.Pages[ idx ];
// ...and add it to the output document.
pdfDocument.AddPage( page );
}

inputDocument.Close();
}

I'll try the fix from the other thread and see if it makes a difference.
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Tue Mar 18, 2008 2:32 pm    Post subject: Reply with quote

dsmeltz wrote:
I'll try the fix from the other thread and see if it makes a difference.

I'm afraid the fix can only help with "invalid token" error messages from Acrobat Reader.
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
dsmeltz



Joined: 24 Jan 2008
Posts: 13

PostPosted: Tue Mar 18, 2008 3:00 pm    Post subject: Reply with quote

Yes, the fixes in the other thread didn't make a difference.

Any other suggestions as to why PDFSharp isn't generating PostScript printable PDF content?
Back to top
View user's profile Send private message
dsmeltz



Joined: 24 Jan 2008
Posts: 13

PostPosted: Wed Mar 19, 2008 11:59 am    Post subject: Reply with quote

I've narrowed the problem down to adding new objects to an existing document. Here's the code were using to add text to a page:

// Get an XGraphics object for drawing
using ( XGraphics gfx = XGraphics.FromPdfPage( page ) ) {
// Draw the text
gfx.DrawString( text, xFont, XBrushes.Black,
new XRect( left, top, right - left, bottom - top ),
XStringFormat.TopCenter );
}
Back to top
View user's profile Send private message
dsmeltz



Joined: 24 Jan 2008
Posts: 13

PostPosted: Wed Mar 19, 2008 1:06 pm    Post subject: Reply with quote

I've figured this out. We are using a Unicode font. 'Arial Unicode MS' to be exact, but I was failing to set the font encoding to 'Unicode'. So that's why PostScript print drivers where having issues with our generated documents.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com