CCITTFaxDecode Image not detected

5 posts, 0 answers
  1. Arnaud
    Arnaud avatar
    25 posts
    Member since:
    Jan 2013

    Posted 23 Dec 2014 Link to this post

    Hello
    I have problem with compressed pdf which use CCITTFaxDecode image.
    I have read that Telerik not fully implement CCITTFaxDecode and I tried to code my own decoder but I never enter in my function because CCITTFaxDecode image was ignore. I have no error and I never enter in my decoder. 
    I use Q1 2014 and I tried Silverlight Demo on your site and I have the same result.
    Have you an idea ?
    Thanks

    PS : How join a pdf example ?
  2. Deyan
    Admin
    Deyan avatar
    137 posts

    Posted 25 Dec 2014 Link to this post

    Hello Arnaud,

    Thank you for contacting us.

    Your custom CCITTFaxDecode filter should implement IPdfFilter interface and an instace of this filter should be registered through the FiltersManager. The following code snippet shows how to create CustomCCITTFaxDecodeFilter class and register it in MainWindow's constructor:
    public MainWindow()
    {
        FiltersManager.RegisterFilter(new CustomCCITTFaxDecodeFilter());
        InitializeComponent();
    }
             
    public class CustomCCITTFaxDecodeFilter : IPdfFilter
    {
        public string Name
        {
            get
            {
                return PdfFilterNames.CCITTFaxDecode;
            }
        }
     
        public byte[] Decode(PdfObject decodedObject, byte[] inputData, DecodeParameters decodeParameters)
        {
            throw new NotImplementedException();
        }
     
        public byte[] Encode(PdfObject encodedObject, byte[] inputData)
        {
            throw new NotImplementedException();
        }
    }

    This way opening some PDF file that uses the CCITTFaxDecode filter the custom implemented Decode method should be called. We have tried the above code both with Q1 2014 and the current version of the product and it seems to be working as expected.

    You can find more detailed information about custom decoders by following this link to Customize PDF Rendering documentation article.

    If you still experiense any issues after trying the suggested approach could you please send us the PDF file that you are trying to decode. As you cannot attach files in forum post you can provide us with link to the file from some external storage.

    I hope this is helpful.

    Regards,
    Deyan
    the Telerik team
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Arnaud
    Arnaud avatar
    25 posts
    Member since:
    Jan 2013

    Posted 14 Jan 2015 in reply to Deyan Link to this post

    Hello Deyan
    Yes I know how it's work, I already make a JBig2 filter. 
    My problem is pdf engine not detect CCITFaxDecode in many pdf (not all) and never call decode function. 
    After investigation, it's concern CCITFaxDecode image wich combine 2 parameters "/Decode [0 1]" and "/ImageMask true". If I remove one parameter, image is detected.
    I link a pdf : Pdf
    Thanks
  5. Deyan
    Admin
    Deyan avatar
    137 posts

    Posted 16 Jan 2015 Link to this post

    Hello Arnaud,

    Thank you for sending us a demo file.

    Looking at the sent file one can see that the image using CCITTFaxDecode filter is actually used as a mask for another image in the document. The current version of RadPdfViewer supports Mask of type "Color Key Masking". However image masking is not supported yet. This is the reason why the CCITTFaxDecode filter Decode() method is not called when opening the PDF.

    We have added this feature request in Telerik's feedback portal. You can vote for it and follow its implementation progress by following this link to image masking feedback item.

    If you have any other questions or concerns please do not hesitate to contact us again.

    Regards,
    Deyan
    the Telerik team
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Arnaud
    Arnaud avatar
    25 posts
    Member since:
    Jan 2013

    Posted 16 Jan 2015 in reply to Deyan Link to this post

    Hello Deyan
    Thanks for feedback. I have voted for this feature.
    I really need this functionnality because many scanners use this functionnality in compress pdf format.
    Thanks
Back to Top
UI for WPF is Visual Studio 2017 Ready