[iText-questions] PDF printing

2006-05-31 Thread Athavale, Sharwari








Hi

I am creating a PDF file from my Java application. Once the
file is created (which happens successfully), I can print that file on some
printers and I am unable to print that file on some printers. What could be the
cause behind this? Any solutions as to where to start debugging this issue? 

 

Best
Regards

Sharwari
Athavale

(734)-668-0005

[EMAIL PROTECTED]

 








[iText-questions] pdf printing

2006-05-25 Thread Vasil Valkov
Hello,
I'm having some problems printing a multi-page pdf document after using iText to create it. I'm trying to print it using the javax.print.* APIs and it's printing only the first page. I think the problem is in the pdf creation process. My flow is the following:

 
- read a pdf template using PdfReader - reader
- create a ByteArrayOutputStream - bs
- create a pdf stamper - PdfStamper(reader, bs)
- set some acro fields with their values
- insert another page to the stamper - stampler.insertPage()
- add another template to the stamper's under content layer
My second page is the same pdf template with different acro values.  When I print, it feels like there is an "end-of-page" tag at the end of the first page where the program quits. How does iText add the second page to the first? I'm not familiar with pdf tags but when I opened the new pdf document with Adobe Pro and looked at the tags, it looked like the second page is a component of the first, not a separate section.  Please, let me know if you are the right person to ask and if not, would you direct me. I can send the Java code I wrote if someone can help me. Thank you.



[iText-questions] PDF printing from Reader is randomly ROT1'ing the printed page(s)

2005-12-15 Thread Jeff Buhrt
Has anyone seen where Acrobat Reader 6/7 would display the text on a PDF 
fine, but when printed sometimes the output was shifted up one ascii 
character like a ROT1? [Like the old days of rot13 encryption.]

So a page with:
  'DATE   12/10/2005'
Would print as:
  'EBUF!!!2302103116'

We have reports from users at different customers using different HP 
printers where they see a text-only PDF fine on the screen, but it 
prints incorrectly. The error will start at the top of a page, sometimes 
page one sometimes 5+, then continue on each page. We have not seen the 
problem correct itself during the same print job, but they are either 
printing shorter documents or forms where they stop the printing. The 
user can immediately reprint the same pdf (or restart reader on it 
again) and the document will print correctly the 2nd time. [One time a 
user had to do a 2nd reprint from inside the same Reader instance to get 
a clean print.] I have not yet found a way to repeat the problem, but we 
get reports of this randomly happening.


Thanks,

-Jeff

Jeff Buhrt
Achievement Focused Technology, Inc.
[EMAIL PROTECTED]




---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions


RE: [iText-questions] PDF Printing

2005-10-07 Thread Soumya
Hi,

Thanks for your reply...

Can you provide me with some sample code which uses GhostScript to
manipulate PDF documents.
An internet resource will be equally good, though I prefer some sample code
in C# because
that would make it easier to comprehend.

Thanks.

-Original Message-
From: Paulo Soares [mailto:[EMAIL PROTECTED]
Sent: Friday, October 07, 2005 1:02 PM
To: [EMAIL PROTECTED]; itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] PDF Printing


As far as I know all the pdf rasterizers are either commercial or GPL. If
you want something free you can use the command line interface to
ghostscript or imagemagik (that uses ghostscript) to render each page to a
bmp.

- Original Message -
From: "Soumya" <[EMAIL PROTECTED]>
To: 
Sent: Friday, October 07, 2005 7:58 AM
Subject: [iText-questions] PDF Printing


> Hi All,
>
> I am using iTextSharp in C# to write an application which can print pdf
> documents on a network printer while programmatically configuring the
> printer.
>
> I am using the PrintDocument class in the System.Drawing.Printing
namespace
> along with PrinterSettings and PageSettings classes
> in order to configure the Printer before printing. But since I am using
> custom printing this will require
> me to specify how to print the document in the PrintPage event of the
> PrintDocument class. Now this PrintPage
> event handler takes an instance of PrintPageEventArgs as an arguement,
using
> which I can get a handle on the
> Printer Graphics Device context and use it to draw whatever I need to
print.
> So essentially I need a way to read
> a pdf document page by page and draw each page content on the
> PrintPageEventArgs.Graphics context.
>
> This is a part of the code that I have written using the TallComponents
> Rasterizer.NET component which works like a dream.
> I need to have the same or similar functionality by using
> iTextSharp(obviously coz its free). Can anyone give me any ideas or some
> sample code to do this.
>
> Thanks,
>
> Soumya
>
> private Document document;
> private IEnumerator DocPages;
> private ArrayList DocPagesList;
>
> private const string PrinterName = @"\\sutlej\SamsungM";
> private const string DocLocation = @"D:\PB-OMSWeb\POC\FileStore\pcu.pdf";
>
> private void cmdPrint_Click(object sender, System.EventArgs e)
> {
> FileStream file = null;
> DocPagesList = new ArrayList();
> try
> {
> file = new FileStream( DocLocation, FileMode.Open, FileAccess.Read );
> byte[] buffer = new byte[ file.Length ];
> file.Read( buffer, 0, buffer.Length );
> document = new Document( new BinaryReader( new MemoryStream(
> buffer ) ) );
>
> for( int i = 0; i < document.Pages.Count; i++ )
> {
> DocPagesList.Add( i.ToString() );
> }
>
> DocPages = DocPagesList.GetEnumerator();
> DocPages.Reset();
>
> if( DocPages.MoveNext() )
> {
> PrintDocument oPrintDocument = new PrintDocument();
> PrinterSettings oPrinterSettings = new PrinterSettings();
> PageSettings oPageSettings = new PageSettings();
>
> oPrinterSettings.PrinterName = PrinterName;
> oPageSettings.Landscape = true;
>
> oPrintDocument.DocumentName = document.Title;
> oPrintDocument.PrinterSettings = oPrinterSettings;
> oPrintDocument.DefaultPageSettings = oPageSettings;
>
> oPrintDocument.PrintPage += new
> PrintPageEventHandler(oPrintDocument_PrintPage);
> oPrintDocument.Print();
> }
> }
> catch( Exception exc )
> {
> lblResult.Text = exc.Message;
> }
> finally
> {
> file.Close();
> }
> }
>
> private void oPrintDocument_PrintPage(object sender, PrintPageEventArgs e)
> {
> e.Graphics.PageUnit = GraphicsUnit.Point;
>
> if ( null != DocPages.Current )
> {
> int pageIndex = Convert.ToInt32( DocPages.Current );
> Page page = document.Pages[ pageIndex++ ];
>
> page.Draw( e.Graphics );
> }
>
> e.HasMorePages = DocPages.MoveNext();
> }
>
>
>
>
> ---
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions




---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions


Re: [iText-questions] PDF Printing

2005-10-07 Thread Paulo Soares
As far as I know all the pdf rasterizers are either commercial or GPL. If
you want something free you can use the command line interface to
ghostscript or imagemagik (that uses ghostscript) to render each page to a
bmp.

- Original Message - 
From: "Soumya" <[EMAIL PROTECTED]>
To: 
Sent: Friday, October 07, 2005 7:58 AM
Subject: [iText-questions] PDF Printing


> Hi All,
>
> I am using iTextSharp in C# to write an application which can print pdf
> documents on a network printer while programmatically configuring the
> printer.
>
> I am using the PrintDocument class in the System.Drawing.Printing
namespace
> along with PrinterSettings and PageSettings classes
> in order to configure the Printer before printing. But since I am using
> custom printing this will require
> me to specify how to print the document in the PrintPage event of the
> PrintDocument class. Now this PrintPage
> event handler takes an instance of PrintPageEventArgs as an arguement,
using
> which I can get a handle on the
> Printer Graphics Device context and use it to draw whatever I need to
print.
> So essentially I need a way to read
> a pdf document page by page and draw each page content on the
> PrintPageEventArgs.Graphics context.
>
> This is a part of the code that I have written using the TallComponents
> Rasterizer.NET component which works like a dream.
> I need to have the same or similar functionality by using
> iTextSharp(obviously coz its free). Can anyone give me any ideas or some
> sample code to do this.
>
> Thanks,
>
> Soumya
>
> private Document document;
> private IEnumerator DocPages;
> private ArrayList DocPagesList;
>
> private const string PrinterName = @"\\sutlej\SamsungM";
> private const string DocLocation = @"D:\PB-OMSWeb\POC\FileStore\pcu.pdf";
>
> private void cmdPrint_Click(object sender, System.EventArgs e)
> {
> FileStream file = null;
> DocPagesList = new ArrayList();
> try
> {
> file = new FileStream( DocLocation, FileMode.Open, FileAccess.Read );
> byte[] buffer = new byte[ file.Length ];
> file.Read( buffer, 0, buffer.Length );
> document = new Document( new BinaryReader( new MemoryStream(
> buffer ) ) );
>
> for( int i = 0; i < document.Pages.Count; i++ )
> {
> DocPagesList.Add( i.ToString() );
> }
>
> DocPages = DocPagesList.GetEnumerator();
> DocPages.Reset();
>
> if( DocPages.MoveNext() )
> {
> PrintDocument oPrintDocument = new PrintDocument();
> PrinterSettings oPrinterSettings = new PrinterSettings();
> PageSettings oPageSettings = new PageSettings();
>
> oPrinterSettings.PrinterName = PrinterName;
> oPageSettings.Landscape = true;
>
> oPrintDocument.DocumentName = document.Title;
> oPrintDocument.PrinterSettings = oPrinterSettings;
> oPrintDocument.DefaultPageSettings = oPageSettings;
>
> oPrintDocument.PrintPage += new
> PrintPageEventHandler(oPrintDocument_PrintPage);
> oPrintDocument.Print();
> }
> }
> catch( Exception exc )
> {
> lblResult.Text = exc.Message;
> }
> finally
> {
> file.Close();
> }
> }
>
> private void oPrintDocument_PrintPage(object sender, PrintPageEventArgs e)
> {
> e.Graphics.PageUnit = GraphicsUnit.Point;
>
> if ( null != DocPages.Current )
> {
> int pageIndex = Convert.ToInt32( DocPages.Current );
> Page page = document.Pages[ pageIndex++ ];
>
> page.Draw( e.Graphics );
> }
>
> e.HasMorePages = DocPages.MoveNext();
> }
>
>
>
>
> ---
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions



---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions


[iText-questions] PDF Printing

2005-10-07 Thread Soumya
Hi All,

I am using iTextSharp in C# to write an application which can print pdf
documents on a network printer while programmatically configuring the
printer.

I am using the PrintDocument class in the System.Drawing.Printing namespace
along with PrinterSettings and PageSettings classes
in order to configure the Printer before printing. But since I am using
custom printing this will require
me to specify how to print the document in the PrintPage event of the
PrintDocument class. Now this PrintPage
event handler takes an instance of PrintPageEventArgs as an arguement, using
which I can get a handle on the
Printer Graphics Device context and use it to draw whatever I need to print.
So essentially I need a way to read
a pdf document page by page and draw each page content on the
PrintPageEventArgs.Graphics context.

This is a part of the code that I have written using the TallComponents
Rasterizer.NET component which works like a dream.
I need to have the same or similar functionality by using
iTextSharp(obviously coz its free). Can anyone give me any ideas or some
sample code to do this.

Thanks,

Soumya

private Document document;
private IEnumerator DocPages;
private ArrayList DocPagesList;

private const string PrinterName = @"\\sutlej\SamsungM";
private const string DocLocation = @"D:\PB-OMSWeb\POC\FileStore\pcu.pdf";

private void cmdPrint_Click(object sender, System.EventArgs e)
{
FileStream file = null;
DocPagesList = new ArrayList();
try
{
file = new FileStream( DocLocation, 
FileMode.Open, FileAccess.Read );
byte[] buffer = new byte[ file.Length ];
file.Read( buffer, 0, buffer.Length );
document = new Document( new BinaryReader( new 
MemoryStream(
buffer ) ) );

for( int i = 0; i < document.Pages.Count; i++ )
{
DocPagesList.Add( i.ToString() );
}

DocPages = DocPagesList.GetEnumerator();
DocPages.Reset();

if( DocPages.MoveNext() )
{
PrintDocument oPrintDocument = new 
PrintDocument();
PrinterSettings oPrinterSettings = new 
PrinterSettings();
PageSettings oPageSettings = new 
PageSettings();

oPrinterSettings.PrinterName = 
PrinterName;
oPageSettings.Landscape = true;

oPrintDocument.DocumentName = 
document.Title;
oPrintDocument.PrinterSettings = 
oPrinterSettings;
oPrintDocument.DefaultPageSettings = 
oPageSettings;

oPrintDocument.PrintPage += new
PrintPageEventHandler(oPrintDocument_PrintPage);
oPrintDocument.Print();
}
}
catch( Exception exc )
{
lblResult.Text = exc.Message;
}
finally
{
file.Close();
}
}

private void oPrintDocument_PrintPage(object sender, PrintPageEventArgs e)
{
e.Graphics.PageUnit = GraphicsUnit.Point;

if ( null != DocPages.Current )
{
int pageIndex = Convert.ToInt32( 
DocPages.Current );
Page page = document.Pages[ pageIndex++ ];

page.Draw( e.Graphics );
}

e.HasMorePages = DocPages.MoveNext();
}




---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions


[iText-questions] PDF Printing to Network printer

2005-08-31 Thread Roopa Kannan




Dear iText support,

Thanks for a wonderful piece of software that makes me breathe easy now...

I solicit your advice on the following requirement of mine.

I have a Java Stored procedure through which I generate a PDF report using
the iText API.  After generating the PDF, I want to print this document in
a network printer in our LAN, which is a HP LaserJet 4300 PCL 6 Network
printer.

I tried using the Oracle UTL_FILE.PUT_RAW packaged procedure to send the
file contents to the printer, however the printer is printing junk
contents.Please advise...

Thanking you in advance..

Roopa



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions


Re: [iText-questions] PDF Printing Problems Related to Images - Sample files

2005-03-29 Thread Leonard Rosenthol
At 10:50 AM 3/29/2005, Jerold Sampson wrote:
I am attaching a zip file containing two one-page docs.  One built with
iText the other uses the Adobe library.
The Adobe PDF views and prints.  The iText views differently and does
not print correctly.
I am surprised that you are finding the iText version to print 
differently - but there is a difference in the images.

The Adobe PDF has converted that TallPine logo to an indexed 8bit 
(uncompressed) data stream - while the iText version has used 
JPEG/DCTDecode compression on the image.

There are a variety of other differences in the internals of the 
PDF as well (eg. use of Form XObjects vs. inline data, etc.)

Leonard
---
Leonard Rosenthol
Chief Technical Officer  
PDF Sages, Inc.  215-938-7080 (voice)
 215-938-0880 (fax)

---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions


Re: [iText-questions] PDF Printing Problems Related to Images

2005-03-02 Thread Paulo Soares
If it prints correctly as image then the problem is with your printer
driver.

- Original Message - 
From: "Jerold Sampson" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, March 01, 2005 10:23 PM
Subject: [iText-questions] PDF Printing Problems Related to Images


> I am having problems printing PDF files which contain images
> using Acrobat Reader.  I am attaching two PDF files.
> Both files view correctly.  The PDF file that includes the
> image as 8-bit views and prints correctly.  The image that contains
> 1-bit image views correctly but does not print correctly.
>
> NOTE: I cannot attach a zip file (it is rejected)
>   and the 8 bit PDF is too big therefore I am sending
> only the 1-bit file for now.
>
> In both cases the original image data is bilevel.  In the 8-bit case
> the bilevel (1 bit) image data is converted to 8-bit first.
>
> The background image that does not print correctly is a Jpeg file.
>
> Both files print correctly if the "print as image" option is selected
> in Acrobat reader.
>
> The code that inserts the image is as follows:
>
> 1-bit
>
> com.lowagie.text.Image pdfImage = new
com.lowagie.text.ImgRaw(tkn.xFilSize,tkn.yFilSize,1,1,tkn.iData);
> int transparency[] = {255, 255};
> pdfImage.setTransparency(transparency);
> cb.addImage(pdfImage,xs,0,0,ys,xp,yp);
>
> 8-bit
>
> int transparency[] = {255, 255};
> byte[] ib = new byte[tkn.xFilSize*tkn.yFilSize];
> Tp.paddedBinToBytes(tkn.iData,ib,tkn.xFilSize,255,0);
> com.lowagie.text.Image pdfImage =
com.lowagie.text.Image.getInstance(tkn.xFilSize,tkn.yFilSize,1,8,ib,transpar
ency);
> cb.addImage(pdfImage,xs,0,0,ys,xp,yp);
>
> This appears to be some kind of transparency issue . . . but I am at a
loss as to what the
> issue is!
>
> Your help is appreciated.
> Sincerely,
> Jerold Sampson
> TallPine Technologies, Inc.
>
>
>



---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions


[iText-questions] PDF printing direct from JAVA

2003-12-17 Thread Reynaldo S. Tamayo
guys,

I'm new in Java Programming and i'm 
having a problem on printing directly the 
PDF generated from database from my Action class.


tanks in advance,

Jun Tamayo
NEC Technologies Philippines


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions


[iText-questions] PDF printing with different margins on different printers(same model)

2003-10-23 Thread jagadish_velaga
Hello,

We have generated a pdf report, to be printed on Avery Label. Each label
should have a fixed length SSN#.
The problem we are facing is, same pdf report when printed on different
printers prints with different margins(about 1/4inch error based on
printer). Because of the margin shift some of SSN#s are not properly placed
inside labels. Noticably, all printers are from same company and same
model.

Later after investigation I found out this margin deltas are observable on
all the pdfs, including those that are not generated from itext.

Any ideas.

Thank You,
jv




---
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions


Re: [iText-questions] PDF printing

2002-07-24 Thread Leonard Rosenthol

At 3:44 PM -0500 7/24/02, Patrick DeZenzio wrote:
>Is there anything within iText that handles printing?

No.

The JPEDAL project (http://www.jpedal.org) folks have a PDF 
rasterizer that might be usuable for printing purposes - I don't know.



>I have sort of got
>this to work, but it requires the user to manually print the document.
>
>   Process pr=null;
>   String arr[] = {"C:\\Program Files\\Adobe\\Acrobat
>5.0\\Reader\\AcroRd32.exe",tmpf.getPath()};

That makes a LOT of assumptions:

1) The user is on the Windows platform
2) The user is on an English version of Windows
3) The user has Acrobat Reader, and NOT the FULL Acrobat, installed.
4) The user has Acrobat Reader 5.0 installed
5) The user has Acrobat Reader 5.0 installed in on Drive C
6) The user installed in the standard location on Drive C.


Leonard
-- 
---
Leonard Rosenthol
Chief Technical Officer  
PDF Sages, Inc.  215-629-3700 (voice)
  215-629-0789 (fax)


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



[iText-questions] PDF printing

2002-07-24 Thread Patrick DeZenzio

Hello all,

I have a user request to print applet information.  As you know, there
is no mechanism to print an applet, but I can build on a project I wrote
that creates PDF documents to be attached to an email.  The problem is
the mechanism to actually print anything is difficult and PDFs make it
worse.  Is there anything within iText that handles printing?  Our users
specifically stated that all they want to do is press a Print button and
it prints without any intervention on their part.  I have sort of got
this to work, but it requires the user to manually print the document.

  Process pr=null;
  String arr[] = {"C:\\Program Files\\Adobe\\Acrobat
5.0\\Reader\\AcroRd32.exe",tmpf.getPath()};
  try {
pr = Runtime.getRuntime().exec(arr);
  } catch (Exception e) {
e.printStackTrace();
  //Handle the exception
  }

This takes the pdf file I created with iText and opens it up with the
acrobat reader.  2 problems:  I can't assume that the user has a
particular version of Acrobat Reader and it's located in the path
specified in the code AND it requires user invention.  I looked at the
Java 1.2 Print API and I'm better off write C code from scratch since it
requires so many things just to print one document.  Any suggestions are
greatly appreciated!!

Thanks,
Patrick Dezenzio



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions