Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
purushothaman
Posts: 5
Registered: ‎08-13-2008
My Device: Not Specified

Connecting Printer to BB and Using PDF files in BB

Hi,

 

It is possible to connect printer to a blackberry device?  I have a requirement to provide printing options in my device application.  Is it possible in J2ME?

 

I have another requirement to open PDF files from my application.  Is it possible to have pdf files in the blackberry device?  Is it possible in J2ME to open up the pdf file from the applcation?  If it is possible, is there any limitations in the file size?

 

It would be helpful for me if anyone helped me at this time.  Thanks in advance.

Please use plain text.
Administrator
MSohm
Posts: 14,277
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Connecting Printer to BB and Using PDF files in BB

There are printers that have BlackBerry support.  You'll need to obtain the printer driver from the printer manufacturer and integrate your application with it.

 

On a BlackBerry, PDF files can be opened when sent as email attachments or when opened from a web server in the BlackBerry Browser.  The BlackBerry does not contain any built in support for displaying local PDF files.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Connecting Printer to BB and Using PDF files in BB

Do you have a link on how this is implemented as I thought there was MDS transcoding involved? I take it you

can't display local pdf files because there is no file system.

 

I'm working on a custom browser and wanted to provide a variety of transcoding options on our own servers.

pdf to text seemed like a good test case since I can get a pdf2text utility that extracts the text saving bandwidth

and rendering time on the phone.

Please use plain text.
New Developer
jrebeiro
Posts: 9
Registered: ‎09-13-2008
My Device: Not Specified

Re: Connecting Printer to BB and Using PDF files in BB

If you are writing an entire browser why dont you just rewrite .pdf links in the HTML to use your server as the transcoder?

 

so <a href="http://link/to/file.pdf"> would be rewritten to <a href="http://transcodingserver/transcode?http://link/to/file.pdf">

 

Then the user just clicks on the link like normal but your transcoder displays it properly.

Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Connecting Printer to BB and Using PDF files in BB

That is what I was going to do, curious to know how they do it now. IIRC, the old nokia I had had a pdf

viewer but I don't recall it worked all that well.

I don't even like opening scanned pdf's on my desktop, LOL.

 

Please use plain text.
New Developer
jrebeiro
Posts: 9
Registered: ‎09-13-2008
My Device: Not Specified

Re: Connecting Printer to BB and Using PDF files in BB

curious how PDF transcoding works?
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Connecting Printer to BB and Using PDF files in BB

I was going to use this since I have modified the source code but typing "pdf2text" on google turns up lots of stuff,

 

http://www.foolabs.com/xpdf/

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,598
Registered: ‎07-14-2008
My Device: Not Specified

Re: Connecting Printer to BB and Using PDF files in BB

I have looked at printing documents directly off a BlackBerry onto a Bluetooth attached printer, and in fact have written something to do this for text based documents so that we can print things from our applications.  I've also looked at printing things like images and color, direct from the BlackBerry.  This is not a job for the faint hearted, for two main reasons:

a) You are effectively going to have write a BlackBerry printer Driver

b) The BlackBerry is not the most powerful beast in the world. 

There is only one printer manufacturer that I am aware of, that has Blackberry specific printer drivers and these are for its small mobile, Black and White devices, i.e. not really the ones you would want to use for printing PDFs anyway.

 

There are a number of packages that do say they print PDF files (typically also including a PDF viewer and the ability to view other 'network resident' files rather than having these on the device).  When printing, I think these are all Server based solutions, so that the document is converted into the printer format, by a Server based printer driver, then the print stream is sent to the BlackBerry and from there on to the attached printer.  I've never used on of these, but I priced one up and compared the cost with the effort I thought I would have to put in to do the printing on the Blackberry, and the product was an order of magnitude cheaper.

Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Connecting Printer to BB and Using PDF files in BB

I took a look at one of the pdf's here on the 7130's BB browser and was rather amazed that

it displayed quite well,

 

http://www.ots.treas.gov/?p=OpenComment&Topic_id=c0316a9e-1e0b-8562-ebd0-1ae5298909e2

 

 

when I used our browser, I got a 406 response and a few paragraphs on security settings

and mime types.  I have a variety of options to diagnose or fool problems, in this case I sent out

an accept */* and was able to get the server to respond with application/pdf which the browser

then rejected as an unsupported media type. Is there anyway to know which features on the native

browser aren't supported on the classes we can use?

Thanks.

 

 

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,277
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Connecting Printer to BB and Using PDF files in BB

I'm not sure what you are asking here.  Are you trying to determine from the server side what content types are supported?  If so, you can use the accepts header for this.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.