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
Contributor
Posts: 23
Registered: ‎10-20-2011
My Device: Blackberry Z10
My Carrier: Airtel

Re: Save set of images to pdf file from Java App

is that a correct way or am in making any mistake in creating PDF ??

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Save set of images to pdf file from Java App

That is pretty much what I have for testing as well... Need some time before I can work on this some more. Busy right now.
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Save set of images to pdf file from Java App

As stated before, the code looks correct.

 

Again, just for clarification. You said:

"if i create a file newfile.txt then it prints all the Logs which are written but if i create with newfile.pdf then its displaying message after clicking on that file "Unable to Display file "."

 

What is "it". The PDF builder? Your app? The PDF builder I made doesn't print out any logs, so I assume that newfile.txt is something you are doing.

 

BlackBerry does not have a build in PDF viewer. Newer ones might come pre-installed with "PDF to Go", but otherwise, if you don't have a PDF viewer installed, you will get the error "Unable to display file" because there is nothing to view the file.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Contributor
Posts: 23
Registered: ‎10-20-2011
My Device: Blackberry Z10
My Carrier: Airtel

Re: Save set of images to pdf file from Java App

i think am going out of the scenario ...

 

my question is

 

build menthod has outputstream argument , so do we need to create a file with.pdf extension and pass to build method or will it (pdf file) gets automatically created ??

 

and will check the same after installing PDF to go on my device !!!

Contributor
Posts: 23
Registered: ‎10-20-2011
My Device: Blackberry Z10
My Carrier: Airtel

Re: Save set of images to pdf file from Java App

atlast i have generated pdf file but even after adding few images , pdf file is empty

 

but pdf size is more or similar set of images size !!!

 

somehow images are not displaying in pdf !! (checked with png and JPEG types)

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Save set of images to pdf file from Java App

You have to create the file and pass the OutputStream to the build function.
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Save set of images to pdf file from Java App

This was the bug I mentioned in the post where I provided the code.

The image is there, it's just really small. I don't really know why since I followed the PDF standard to the best of my understanding.

I'm still trying to figure it out myself. It's a transformation thing (located under the "//Contents" comment in the build function), at least I'm pretty sure.
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Save set of images to pdf file from Java App

Ok, I found and fixed the bug. Go get the newest version of Image2PDFBuilder (the rest of the code didn't change).
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Contributor
Posts: 23
Registered: ‎10-20-2011
My Device: Blackberry Z10
My Carrier: Airtel

Re: Save set of images to pdf file from Java App

Hey its working flawlessly thanks a ton man !!!! Cheers to you and your work !!!

 

Checked both on simulator and device and its working on both !!

 

 

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Save set of images to pdf file from Java App

Good to know.
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.