Thursday, October 18, 2007

BI Publisher: Merge PDF's - Why would I ever want to do that?

When you first read that BI Publisher has the ability to merge PDF documents it's neat but you think, "I’ll never use that." Well not necessarily. Remember merging files together is new functionality in the EBS suite. Nobody knows that developers have this kind of power at there finger tips now. But it still gets a back to why would you ever want to do this. There are really two main reasons to merge PDF documents:

1. Automation
2. Desperate Content (documents in different systems)
Let’s just say you’re dealing with PDF attachments in EBS Suite. The business has requested that when there is an attachment they want it to be apart of some other standard document. Well, you can’t do that in reports6i with PDF’s but in BI Publisher this is a no brainer. You grab the blob, write out to file and then call the PDFDocMerger Utility.

Here’s a more long winded scenario. Your company works with hazardous materials. Some chemicals are so volatile that if there ever was a spill, having a MSDS (Material Safety Data Sheet) with the shipper/driver might be extremely helpful to authorities to resolve the situation quickly and safely. However you shipping personnel on the floor are just absolutely swamped and there is potential to miss that step. Well, the document merger might be nice tool solve that issue. Now the shipping personnel don’t have to worry about finding an MSDS on the system to give to the driver. This happens automatically based on some business logic coded in a concurrent program that generates a BOL and then finds a MSDS and merges the two documents before printing (Automation and Desperate Content). The shipping personal go right to the printer and pick up one document!

Normally, I would paste some sort of code snippet here. But the BI Publisher documentation for the PDFDocMerger API is really good and implementing it is very simple.

Good Luck!

Ike

6 comments:

Krishna said...

I have a document that was done with PDF1.6 specification. But the BI publisher API does not handle the document. It gives an error and wants the pdf template to be with spec 1.4.
Is there a way for the PDF1.6 templates to work with BI?
Thanks

Ike Wiggins said...

I have never run into this. I'm assuming one of the pdf's was not from BIP. Very interesting....

Can you send me your code and I'll see if I can figure-out a workaround. You can find my e-mail on the site.

Ike Wiggins

Ike Wiggins said...

Bummer, I wrote the some code to test your format templates and I got the same error. The next steps in getting this issue resolved will be logging a ticket with oracle to get this fixed. If they come up with an alternative resolution. Please post the resolution here.


[010709_103723603][][STATEMENT] Logger.init(): *** DEBUG MODE IS OFF. ***
[010709_103723634][][STATEMENT] PDF template is being read and parsed......
[010709_103723634][][STATEMENT] PDFParser uses this tempDir ::: C:\DOCUME~1\iwiggins\LOCALS~1\Temp\
[010709_103723759][][STATEMENT] PDFParser.readPDFFile ---> contents size : 16643
[010709_103723759][][STATEMENT] Creating new hashtable of type: oracle.apps.xdo.template.pdf.util.FPHashtable
[010709_103723822][][STATEMENT] This template's PDF version : 1.4
[010709_103723931][][STATEMENT] The template parsing is done......
[010709_103723946][][STATEMENT] FormInfoCollector is being initialized......
[010709_103723946][][STATEMENT] FormInfoCollector initialization is done......
[010709_103723946][][STATEMENT] PDF template is being read and parsed......
[010709_103723946][][STATEMENT] PDFParser uses this tempDir ::: null
[010709_103723993][][STATEMENT] PDFParser.readPDFFile ---> contents size : 10630
[010709_103723993][][STATEMENT] This template's PDF version : 1.6
[010709_103723993][][STATEMENT] oracle.apps.xdo.template.pdf.exception.FatalException: The template seems to be in either corrupted one or newer version than PDF1.4

Krishna said...

Ike,

Thanks for your effort and help.
I created the PDF. I am working on the workaround.
Will communicate that with you.
Also, I will contact Oracle.

Thanks Again
Krishna

Ashish said...

Hi,

We are trying to merge several RTF's into 1 PDF using PDFMerge, and running into the same issue as Krishna did.
We have an SR open with Oracle (for the last 4 weeks), but if there is a workaround, can you please share?
Any help would be greatly appreciated.
Initially we tried to merge the RTF's and then create the PDF. Now we are creating individual PDF's and then merging them. However, error is the same in both cases. Can you suggest which approach is better?

Thanks
Ashish

Ike Wiggins said...

There is no workaround that I know.