Results 1 to 7 of 7

Thread: Create and show pdf in sencha modern toolkit.

  1. #1
    Sencha User
    Join Date
    Aug 2015
    Posts
    28
    Answers
    1
    Vote Rating
    3
      0  

    Default Create and show pdf in sencha modern toolkit.

    How to Create pdf in sencha modern toolkit.
    I am searching on internet, but I didnt understand how to implement in sencha modern toolkit.
    Can anyone give me proper Fiddle example for generating pdf in modern???
    Please give me solution.


    Thanks in Advance,
    Anand Chordiya

  2. #2
    Sencha Premium Member yorl1n's Avatar
    Join Date
    Mar 2015
    Location
    Germany
    Posts
    294
    Answers
    30
    Vote Rating
    47
      0  

    Default

    Do you need to preview or generate pdf's ? Do you have examples with classic toolkit? In any case I would prefer Mozilla's PDFJS. At least I use it in our application.

  3. #3
    Sencha User
    Join Date
    Aug 2015
    Posts
    28
    Answers
    1
    Vote Rating
    3
      0  

    Default

    Hi

    I need example Modern toolkit. I Have create one sample code using.
    Through this code, Pdf shows in browser but not in mobile view.

    Please give me solution or any fiddle example.


    Ext.define('TrialApp.view.main.DemoPdf', {
    extend: 'Ext.Container',
    xtype: 'demopdf',

    requires: [

    'Ext.form.Panel'
    ],

    items: [
    {
    xtype: 'formpanel',
    width:'100%',
    height: '800',
    html: '<iframe src="http://fzs.sve-mo.ba/sites/default/files/dokumenti-vijesti/sample.pdf" style="width: 100%; height:600px"></iframe>'
    }
    ]

    });

  4. #4
    Sencha Premium Member yorl1n's Avatar
    Join Date
    Mar 2015
    Location
    Germany
    Posts
    294
    Answers
    30
    Vote Rating
    47
      0  

    Default

    You just provide a link for the browser. Every browser(today) has its own implementation of pdf viewer(at least modern most popular desktop versions of the browsers) but mobile hasn't.
    Here is a link on demo of pdfjs https://mozilla.github.io/pdf.js/web/viewer.html . Could you try it on mobile device?

  5. #5
    Sencha User
    Join Date
    Aug 2015
    Posts
    28
    Answers
    1
    Vote Rating
    3
      0  

    Default

    Thank you yorl1n for this link.
    I have tried in mobile and its working.

    But If Suppose If I want to change given pdf to My pdf file then in that case How Can I do this???




    Ext.define('TrialApp.view.main.DemoPdf', {
    extend: 'Ext.Container',
    xtype: 'demopdf',

    requires: [

    'Ext.form.Panel'
    ],

    items: [
    {
    xtype: 'formpanel',
    width:'100%',
    height: '800',
    html: '<iframe src="https://mozilla.github.io/pdf.js/web/viewer.html" style="width: 100%; height:600px"></iframe>'
    }
    ]

    });

  6. #6
    Sencha Premium Member yorl1n's Avatar
    Join Date
    Mar 2015
    Location
    Germany
    Posts
    294
    Answers
    30
    Vote Rating
    47
      0  

    Default

    It was just example how the library works. You can download the library and implement your own viewer using it. I'm afraid it will be the only cross-browser solution.

  7. #7
    Sencha Premium Member yorl1n's Avatar
    Join Date
    Mar 2015
    Location
    Germany
    Posts
    294
    Answers
    30
    Vote Rating
    47
      0  

    Default

    I have wrapped the PDF.js into simple component, that uses pdfjs's viewer as template.
    The sourcecode you can find here. Here is example and sourcecode of example.

Similar Threads

  1. Tree in Modern toolkit
    By wbabich in forum Ext 6: Q&A
    Replies: 3
    Last Post: 13 Oct 2015, 6:35 AM
  2. Draw with modern toolkit
    By rocco.celsi in forum Ext 6: Q&A
    Replies: 1
    Last Post: 9 Aug 2015, 2:17 PM
  3. What's coming soon in the Modern toolkit?
    By wbabich in forum Ext 6: Q&A
    Replies: 1
    Last Post: 3 Aug 2015, 5:50 AM
  4. Replies: 3
    Last Post: 7 Jul 2015, 7:08 AM
  5. Ext.Promise on modern toolkit only??
    By chanand in forum Ext 6: Q&A
    Replies: 3
    Last Post: 17 Jun 2015, 8:48 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •