cancel
Showing results for 
Search instead for 
Did you mean: 

Error of PDF Conversion to Tif

Scott_Johnson3
World-Class Innovator
World-Class Innovator

I am running 11.0.1 on server 2008 (64).  I am trying to convert a simple PDF to a Tif.  (Yes we have a PDF Foundation License).  I get this error is the Diag console:

An error occurred within the Unity API: Value cannot be null.
Parameter name: DefaultPageHandler requires a DocumentPage object. Use different overload.   

I added a test for a non-null rendition and that did not help.  The only other overload  adds another parameter of type imagegetdocumentproperties which does not make sense.

 

Here is my code:

                   Rendition rendition = document.DefaultRenditionOfLatestRevision;

                    ImageDataProvider OBProvider = app.Core.Retrieval.Image;
                    string fullPath;
                    using (PageData pageData = OBProvider.GetDocument(rendition))         // Failure point      
                    {
                        // use extension from page data object
                        fullPath = String.Format(@"{0}\{1}.{2}", BasePath, docname, pageData.Extension);   
                        // Create file
                        using (Stream stream = pageData.Stream)
                        {
                            Utility.WriteStreamToFile(stream, fullPath);
                        }
                   }

 

Suggestions?

9 REPLIES 9

Scott_Johnson3
World-Class Innovator
World-Class Innovator

Authur

Unless I am missing something  that would not work. I need a TIF file not a PDF as a output.  

Timothy_Cosgrif
Star Collaborator
Star Collaborator

This issue helped us figure out a bug in the data provider. Aparently it will fail out when trying to convert more than 1 page.

A temporary fix would be to add the following lines:

ImageGetDocumentProperties imgProps = prov.CreateImageGetDocumentProperties();

imgProps.PageRanges = app.Core.Retrieval.Image.CreatePageRangeSet("1");

...and then using the imgProps as the second parameter in the GetDocument call.

Unfortunately, it only works to convert 1 page, anything else will fail out. An SCR has been created and I will update this thread once the fix is made and tested.

Timothy_Cosgrif
Star Collaborator
Star Collaborator

The SCR referenced above is completed and is now in the latest OnBase 12 release.

Tim

Do you mean Core 12.0.0.47?

Thanks

Scott

Timothy_Cosgrif
Star Collaborator
Star Collaborator

Yes, the fix is in 12.0.0.47