I have added C1FlexViewer to a few of my solutions

Posted by: john.burke on 12 April 2018, 3:26 pm EST

    • Post Options:
    • Link

    Posted 12 April 2018, 3:26 pm EST

    Is there any documentation on how I can customize the C1FlexViewer?

    Some best practices?

    All I could find was how to Load a document using C1PdfDocumentSource.

    It looks like it works great. A little slower than my previous PDF Viewer from Gnostice. Similar functionality but way more available to the user in the Ribbon.

    If anyone has any advice on how to speed up the rendering, that would be great as well.

    John

  • Posted 13 April 2018, 12:28 am EST

    Hello John,

    There is no direct documentation link explaining the customization of a C1FlexViewer yet.

    Below mentioned are two ways of customizing a C1FlexViewer:

    a) For adding new ribbon tab(s) in C1FlexViewer and C1RibbonPreview, use the below code snippet:

                //Flex viewer
                c1FlexViewer1.Ribbon.HideTabHeaderRow = false;
                c1FlexViewer1.Ribbon.Tabs.Add(new C1.Win.C1Ribbon.RibbonTab("Tab 1"));
                
                //Ribbon preview
                c1RibbonPreview1.Ribbon.HideTabHeaderRow = false;
                c1RibbonPreview1.Ribbon.Tabs.Add(new C1.Win.C1Ribbon.RibbonTab("Tab 1"));      
    

    b) You can change the icons in the preview component as per your requirement(s), using:

    ```

    //Change images in flex viewer

    c1FlexViewer1.RibbonElements.Print.LargeImage = imgLarge;

    c1FlexViewer1.RibbonElements.Print.SmallImage = imgSmall;

            //change images in ribbon preview
            c1RibbonPreview1.RibbonElements.Print.LargeImage = imgLarge;
            c1RibbonPreview1.RibbonElements.Print.SmallImage = imgSmall;
    
    c) You can set a C1FlexViewer's elements to be right aligned, using: 
    
    c1FlexViewer1.RightToLeft = RightToLeft.Yes;
    
    If this is not what you need, please share the requirement and we will help you accordingly. 
    
    As of now, how much time does it take for a pdf/report to render for you? We would need the below mentioned information to be able to assist you:
    1. The size of the pdf/report being used. 
    2. Code snippet showing the preview operations performed at your end. 
    3. Environment of the system.
    4. A demo pdf/report with which you face the issue. 
    
    Best Regards,
    Esha
  • Posted 16 April 2018, 10:00 am EST

    I do not have a code snippet, right now it is very simple.

    I am setting one property on the FlexViewer:

    Me.PDFViewer.ZoomMode = C1.Win.FlexViewer.FlexViewerZoomMode.WholePage

    To load the document:

    C1PdfDocumentSource.LoadFromFile(DialogFilePath)

    PDFViewer.DocumentSource = C1PdfDocumentSource

    I could use some documentation on how the C1PdfDocumentSource works.

    Does it put any locks on the file it is opening?

    Does it keep the file open during viewing?

    Do I just set the C1PdfDocumentSource = Nothing when I am done?

    The answers are important because I am usually manipulating the .pdf immediately after viewing. Like appending it to another .pdf or removing pages from the viewed .pdf.

    Thanks,

    John

  • Posted 17 April 2018, 5:38 am EST

    Hello John,

    Does it put any locks on the file it is opening?

    C1PdfDocumentSource puts no restrictions/locks on the pdf files it opens.

    Does it keep the file open during viewing?

    Do you mean the C1PdfDocumentsource instance? The file once loaded in C1PdfDocumentSource is used for preview through that instance itself. In case you wish to make changes to the pdf file, you can either wait for the file to be previewed through the C1FlexViewer or maintain a copy of the file for other uses.

    Do I just set the C1PdfDocumentSource = Nothing when I am done?

    Yes, you can do so. This will make the instance to have no file now and then, you can add new ones as per your requirement.

    Below mentioned documentation link for C1PdfDocumentSource would help you understand about the product in detail:

    http://help.grapecity.com/componentone/NetHelp/C1Document/webframe.html#PDFDocumentSource-for-WinForms.html

    Best Regards,

    Esha

  • Posted 17 April 2018, 2:43 pm EST

    Does it put any locks on the file it is opening?

    C1PdfDocumentSource puts no restrictions/locks on the pdf files it opens.

    The reason I ask this question is because the previous control I was using to view .PDF files would keep the file open until you called the .CloseDocument() method of the control.

    Thus, I could not manipulate the .PDF file on the same form in which it was viewed.

    While I was using the C1PdfDocumentSource and FlexView to view a .PDF, I was able to Delete the underlying .PDF. That is the functionality I want.

    Thank you.

  • Posted 18 April 2018, 1:40 am EST

    Hello,

    With C1PdfDocumentSource, you can view a pdf file in C1FlexViewer, and then use the same instance for various scenarios. You need not close the file / deallocate the instance specifically for this purpose.

    >>While I was using the C1PdfDocumentSource and FlexView to view a .PDF, I was able to Delete the underlying .PDF. That is the functionality I want.

    We’d request you to share the use-case with us. This will help us understand your requirement here and assist you at the earliest.

    Thanks,

    Esha

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels