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

Timothy_Cosgrif
Star Collaborator
Star Collaborator

The above code is correct, it looks like there must be a configuration problem somewhere. Check to make sure the File Format of the Document Type you are retrieving is set to PDF. I ran a test with similar code retrieving a PDF Document from a Document Type configured to Image File Format and received the same exception as you.

Scott_Johnson3
World-Class Innovator
World-Class Innovator

Yes the extension is PDF  and file format is #16.  I have a filter in my code limiting the file types.   I just added this License the other day.  Do I need special dll as the sdk implies?  I have the files from conversionfiles.zip installed already because I have been using the Office to image framework.  Is there any other configuration setting I should look at as well?

Scott_Johnson3
World-Class Innovator
World-Class Innovator

I got it working sometimes when I ran the MSi in web110176DatalogicsServerExtension.zip.  I still get the error message PDF Library Error: Bad parameter. Error number: 1073741827 in diag console even when it works.   It does not work on larger PDFs, 250 page in my tests but .   It smells like a time out (Unexpected error: Thread wasbeing aborted....)  suggestions anyone?

Not applicable

You can try to change the Data Provider...

Try to replace:  

ImageDataProvider OBProvider = app.Core.Retrieval.Image;

TO

PDFDataProvider OBProvider = app.Core.Retrieval.PDF