⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Multiple uploader for pdf files and add text type fileds dynamically



Hamelraj
  • profile picture
  • Member

Posted 16 June 2015 - 10:11 AM

HI Amit,
1.i want know how to  upload multiple files(PDF) from single column.  i try Amith Shah code but we can upload pdf file but we cant view that file by click.like a image.

2.same like i want add many text type fileds dynamically like this http://bootsnipp.com/snippets/featured/dynamic-form-fields-add-amp-remove .

3.and i want get print(A4) every row by row data in mysql. i dont want add print button on table using  set_action what i mean was after cheking that particular row that  sheets need to be print o we need to add button below of that form. then user can easlly get print.

 

i used Amith Shah Multiuploder  code so i add pdf format also ... but  below i will attache what i got when i click pdf file ?


arronlee
  • profile picture
  • Member

Posted 27 February 2016 - 04:48 AM

I think the first step we should access is text extration from pdf files. Any suggetion?


Amit Shah
  • profile picture
  • Member

Posted 28 February 2016 - 18:52 PM

Hi there,

 

Good to see you are trying to make use of GC to much better extent and use.

 

As for text extraction stuff is concerned - there are php libraries available to extract text out of the PDF - u can use them ... but mind it - they are way too shaggy.. cuz it will extract pure text with all line breaks and not formatted text. Atleast i have failed in getting better result with free libraries available.

As if u wana generate a image out of the PDF - u can use ImageMagik - it have a convert - utility .. that will help you convert your pdf into a jpg. There are open php libraries that are available to convert the pdf to image but the best part is using a imagemagik utility rather then library.. its my personal experience m sharing with you.

Once you have converted, now if you wana show preview for the same - what you need to do is play around with the code in GC Library to render the thumbnail of pdf and show the preview image instead of PDF link

One of the function such as - get_upload_file_input

 

This is just 1 function - u need to find - all possible places it uses '.jpg' - where it uses that - to render - u can set the PDF too .. when pdf - use converted image rather then the pdf link.

 

As for your requirement  of myltiple text boxes - u can achieve it by using the same / similar javascript to achieve the functionality. One thing u need to understand / remember is to use callback_before_insert OR callback_insert to handle / manage such additional inputs. If you don't, GC will try to create a new record with all the fields it finds. If it is not able to find the relevant field name in the table - it will thrw error.

 

Hope the solution shared works for you.

 

Happy GCing :)