Write PDF - Android Studio - Java

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ต.ค. 2024

ความคิดเห็น • 111

  • @julianosantos4887
    @julianosantos4887 5 ปีที่แล้ว +2

    It did not workshop the first time. The POPUP was not shown whit the ALLOW AND DENY options, but I changed the part of the code related to the permission request and it worked. 🤩🤩🤩 thank you for shared this method

  • @WolfgangHuber-wx6gz
    @WolfgangHuber-wx6gz 7 หลายเดือนก่อน

    java:414: error: incompatible types: PdfDocument cannot be converted to Document. 'PdfWriter.getInstance(mDoc, new FileOutputStream(mFilePath));' Related to 'mDoc'. //Original
    I can't repair it. What's the matter?

  • @hakambaihaqi5415
    @hakambaihaqi5415 5 ปีที่แล้ว

    kamu penyelamat tugasku
    makasih banget tutorialnya
    workk bngitt

  • @husna9124
    @husna9124 4 ปีที่แล้ว

    Sir I have a question, it throws "open failed (EROFS) read-only file system" when I click the save pdf button. please help me..

  • @nwcoder
    @nwcoder 2 ปีที่แล้ว +1

    How to create image file to pdf file on java,Please make an tutorial video..

    • @AtifSayings
      @AtifSayings  2 ปีที่แล้ว +1

      I've started video series for it. Check it out

    • @nwcoder
      @nwcoder 2 ปีที่แล้ว

      @@AtifSayings tnx..❤️

  • @RaghavSharma-nt3hr
    @RaghavSharma-nt3hr 3 ปีที่แล้ว

    Could you please help?
    I am creating pdf from a text files containing around 200 lines. But when the pdf is created the text overflows the page instead of going to next page. (I am using itext)
    How can i bring the rest of the text to next page?

  • @mubeenhaider7232
    @mubeenhaider7232 4 ปีที่แล้ว

    sorry but I am facing issue in Document Constructor and PdfWriter class is not giving getInstance method and open() method also
    please help me ASAP

  • @Ikkin267
    @Ikkin267 5 ปีที่แล้ว

    ERROR: Failed to parse XML in C:\Users\Ken\AndroidStudioProjects\WritePDF\app\src\main\AndroidManifest.xml
    ParseError at [row,col]:[6,5]
    Message: expected start or end tag
    Affected Modules: app
    Hi sir I have an error. How to fix though?

  • @rockonrahul967
    @rockonrahul967 4 ปีที่แล้ว +1

    Thanks for this awesome tutorial

  • @ericboniface6474
    @ericboniface6474 4 ปีที่แล้ว +1

    Thank you so much

  • @86kuntalmohan
    @86kuntalmohan 4 ปีที่แล้ว +1

    The App is running in Android Studio emulator, but in phone it is showing "/storage/emulated/0/20.........pdf: open failed: EACCESS (Permission denied)". Can you say me sir, why?

    • @AtifSayings
      @AtifSayings  4 ปีที่แล้ว +2


      ...

    • @86kuntalmohan
      @86kuntalmohan 4 ปีที่แล้ว

      @@AtifSayings Thank you very very much.... Now, its running nicely....

    • @mohamedagbaria3454
      @mohamedagbaria3454 3 ปีที่แล้ว

      @@AtifSayings where to add it ?

  • @BHARATGARANDE
    @BHARATGARANDE 3 ปีที่แล้ว

    I have an Arraylist, it has 100+ lines Data. I want to print it or make a PDF, as per page 20 lines...How to make PDF..Please sir help us...

  • @JamshedAli-jo6uf
    @JamshedAli-jo6uf 3 ปีที่แล้ว

    Is Itextpdf free library? Can we upload an app containing itextpdf library and generate revenue from ads by uploading it on PlayStore?

  • @samidhakhatri9484
    @samidhakhatri9484 5 ปีที่แล้ว +1

    Thank you so much for this video!!! It really helped

  • @AIAvatar.
    @AIAvatar. 5 ปีที่แล้ว

    Hello sir I have a query.is itext free to use?? as i am developing a small app for my comapny and i don't want any license breaching issues.Please guide me urgently..Cheers

  • @jsepol
    @jsepol 4 ปีที่แล้ว +1

    Thanks! This worked fine with me! Great job!

    • @AtifSayings
      @AtifSayings  4 ปีที่แล้ว +1

      You're welcome

    • @colorsngraphite
      @colorsngraphite ปีที่แล้ว

      @@AtifSayings sir i need a little help with this code....plz can u help

  • @alencarburitijr
    @alencarburitijr 3 ปีที่แล้ว +1

    Thanks for the content.
    I need to develop an app where I can do pen writing in the pdf.
    I found some apps but I'm having trouble saving. Apparently he only sporadically saves some parts.
    I created a process to send the file to be changed to googledrive and through my ERP I read if it was changed or not but I have some flaws that would need to integrate the ERP with a proprietary app and be able to carry out business rules .

  • @gianfrancopercopo9036
    @gianfrancopercopo9036 4 ปีที่แล้ว +1

    iText is not free library. You don't use form commercial product on play store....
    iText is licensed as AGPL software.
    AGPL is a free / open source software license.
    This doesn't mean the software is gratis!
    Buying a license is mandatory as soon as you develop commercial activities distributing the iText software inside your product or deploying it on a network without disclosing the source code of your own applications under the AGPL license. These activities include:
    offering paid services to customers as an ASP serving PDFs on the fly in the cloud or in a web application shipping iText with a closed source product

  • @real33479
    @real33479 4 ปีที่แล้ว +2

    How do I make it support the Arabic language?

    • @AtifSayings
      @AtifSayings  3 ปีที่แล้ว

      Isn't it supporting have you tried?

    • @real33479
      @real33479 3 ปีที่แล้ว

      Yes, I tried a lot, but the writing does not appear in Arabic, only English

    • @mohamedagbaria3454
      @mohamedagbaria3454 3 ปีที่แล้ว

      how you solve this problem ? add Language ?

  • @x-bowmasters3241
    @x-bowmasters3241 5 ปีที่แล้ว +1

    NICE.... thanx very much!

  • @alishiraz6692
    @alishiraz6692 5 ปีที่แล้ว +1

    How to set alignments of text, size, style and colors according to our choise in PDF. Here data is only saving in PDF as it is typed but I want editing how can I do that?

    • @AtifSayings
      @AtifSayings  5 ปีที่แล้ว

      www.tutorialspoint.com/itext

  • @tadjerfatimazohra
    @tadjerfatimazohra 5 ปีที่แล้ว

    thanks , but i show this problem, help my please,
    Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
    > More than one file was found with OS independent path 'com/itextpdf/text/pdf/hyphenation/hyph/readme.txt'
    version android : 3.0.1

  • @prasannaakolka
    @prasannaakolka 4 ปีที่แล้ว +1

    U r the best!

  • @SathishKumar-zx4qz
    @SathishKumar-zx4qz 6 ปีที่แล้ว

    Bro....in your playlist has retrieve view... videos collection... totally 9 videos are there.....I can do the 1st video, after I complete the Java code..I run the app on my mobile phone, but it will show..... unfortunately the app has stopped..... please help me.... what can I dooo

  • @shawonsarker2741
    @shawonsarker2741 3 ปีที่แล้ว

    storage/emulated/0/20210216_145402.pdf OPEN FAILED OPERATION NOT PERMITTED?? PLS HELP ME

  • @mtomic000
    @mtomic000 5 ปีที่แล้ว +1

    Thanks for this awesome tutorial! It worked like a charm.
    What is the easiest way to open saved pdf right away from the app?

    • @keithscull8288
      @keithscull8288 5 ปีที่แล้ว +2

      To OPEN the PDF file as soon as it's created, take the File object created in this video and create/call the below method:
      private void openPdfFile(File pdfFile) {
      if(Build.VERSION.SDK_INT>=24){
      try{
      //For API's > 24, runtime exception occurs when a URI is exposed BEYOND this particular app that you are writing (AKA when user attempts to open in device/emulator
      Method m = StrictMode.class.getMethod("disableDeathOnFileUriExposure");
      m.invoke(null);
      }catch(Exception e){
      e.printStackTrace();
      }
      }
      Intent target = new Intent(Intent.ACTION_VIEW);
      target.setDataAndType(Uri.fromFile(pdfFile),"application/pdf");
      target.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
      Intent intent = Intent.createChooser(target, "Open File");
      try {
      startActivity(intent);
      } catch (ActivityNotFoundException e) {
      // Instruct the user to install a PDF reader here, or something
      }
      }

    • @christophkurbisch9125
      @christophkurbisch9125 2 ปีที่แล้ว +1

      @@keithscull8288 thx

  • @hannahbullo9661
    @hannahbullo9661 5 ปีที่แล้ว +1

    hello sir. is the code usable if I am going to generate a pdf file from a table view? I mean I'm going to transfer the table into pdf.

    • @AtifSayings
      @AtifSayings  5 ปีที่แล้ว

      it's a simple startup video to make app generate pdf.
      This video only generates pdf of the text entered in edit text.

  • @keithscull8288
    @keithscull8288 5 ปีที่แล้ว

    No matter what I try this never ever EVER works on certain API level emulators, I tried on API emulator 23 and the same code worked that didn't' work on 29. And yes I tried EVERYTHING, manifest permissions (yes the cases are correct and yes they're in the right location), I requested and checked for permission via Java code by calling ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1000);, then I override the onRequest PermissionsResult, and looking in the emulator it states my app has been granted storage permissions. It just doesn't work on most higher level API emulators.

    • @keithscull8288
      @keithscull8288 5 ปีที่แล้ว +1

      Update - I think I realize why this wasn't working with API 29, as the android doc states Environment.getExternalStorageDirectory() was deprecated as of API 29, and likewise direct access direct access to user stored/shared data is a depractaced methodology. Alternatively, you now use context.getExternalFilesDir(String), though I haven't gone back to API 29 to test this as I've finally got my code happily working with the Environment method in API 27

    • @zakblacki
      @zakblacki 4 ปีที่แล้ว

      @@keithscull8288 Not working I tried replace context.getExternalFilesDir(String) can you put your code please

  • @darvzchannel
    @darvzchannel 5 ปีที่แล้ว +1

    Hi sir, Can you help me? I want to Bold one string inputted inside the Paragraph. How should i do?

    • @AtifSayings
      @AtifSayings  5 ปีที่แล้ว +1

      Didn't tried. Check documentation of the library

    • @darvzchannel
      @darvzchannel 5 ปีที่แล้ว

      @@AtifSayings please help me how. Im just a newbie

    • @AtifSayings
      @AtifSayings  5 ปีที่แล้ว

      @@darvzchannel Almost complete guide for iText Pdf library is here: www.tutorialspoint.com/itext/

  • @mohamedagbaria3454
    @mohamedagbaria3454 3 ปีที่แล้ว +1

    open faild:EPERM (Operation not permitted) ? why

    • @AtifSayings
      @AtifSayings  3 ปีที่แล้ว +1

      If you're running Android 11 or above need to request MANAGE_STORAGE permission because WRITE EXTERNAL STORAGE permission will no longer work

    • @kavitasoni4947
      @kavitasoni4947 2 ปีที่แล้ว

      @@AtifSayings Please explain more on this.. Still not working

  • @shafqatali3065
    @shafqatali3065 3 ปีที่แล้ว

    Sir PDF is not opened until I manually renamed it.........help

  • @badder002
    @badder002 5 ปีที่แล้ว

    Brother can we use this itext library to input into fillable forms inside pdf files

  • @pakgeochannel8419
    @pakgeochannel8419 3 ปีที่แล้ว

    Pass EditText two Activity one pdf file show ho acs ke coding kea hai

  • @waqarsaleem615
    @waqarsaleem615 4 ปีที่แล้ว

    Hello Sir!Can you tell me how to generate an invoice in the form of PDF.

  • @deepaksingh-pp5tw
    @deepaksingh-pp5tw 4 ปีที่แล้ว

    Brother
    How to add Hyperlinks in a pdf file using Android Studio?
    Using android.graphics.pdf object

  • @marwarabia7081
    @marwarabia7081 3 ปีที่แล้ว

    Thank you
    Please when i wrote arabic words not appear
    What should I do?

    • @mohamedagbaria3454
      @mohamedagbaria3454 3 ปีที่แล้ว

      مرحبا مروة كيف حليتي مشكلة اللغة ؟

  • @irineufarias6688
    @irineufarias6688 5 ปีที่แล้ว

    When I run the app by clicking the button and it says that message in the toast "
    There is no such file or directory "what can it be?

  • @Hyazoulephant
    @Hyazoulephant 4 ปีที่แล้ว

    To save pdf in "Download" doc with itext7 :
    String mPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/" + mFileName + ".pdf";

  • @HemanShakthiMohanUdaiyar
    @HemanShakthiMohanUdaiyar 4 ปีที่แล้ว

    getExternalStorageDirectory() is Deprecated !
    the Pdf is not generated

  • @darvzchannel
    @darvzchannel 5 ปีที่แล้ว

    besides Paragraph, How to set Center alignment text??

  • @youcoool12
    @youcoool12 5 ปีที่แล้ว

    How coud i do formating? like bold text and text size

  • @MohsenMashkour
    @MohsenMashkour 4 ปีที่แล้ว

    hello. how can i add photo to this pdf file?

  • @acetech529
    @acetech529 5 ปีที่แล้ว +1

    Dear sir, My textview pdf is not being generated - - - Show

    • @AtifSayings
      @AtifSayings  5 ปีที่แล้ว

      elaborate, what happens when you save?

  • @pakgeochannel8419
    @pakgeochannel8419 3 ปีที่แล้ว +1

    اس پی ڈی ایف فائل میں اردو کومحفوظ کرنے کا طریقہ کیا ہے اس کی اردو کو محفوظ کرنے کی کوڈنگ جاوا کیا ہے

    • @AtifSayings
      @AtifSayings  3 ปีที่แล้ว

      Switch keyboard to urdu and type in urdu, that's it...

    • @pakgeochannel8419
      @pakgeochannel8419 3 ปีที่แล้ว

      @@AtifSayings Urdu ko save karne ke bad PDF file ko check karte hain to PDF file mea Urdu show Nahi Hotie

  • @SpidermanBerbatik
    @SpidermanBerbatik 5 ปีที่แล้ว +1

    Sir, itext library trial 30day, btw i wanna ask how to create pdf from webview 😥😥 (create, not download)

    • @AtifSayings
      @AtifSayings  5 ปีที่แล้ว

      What? 30 day trial? where you received that message?

    • @SpidermanBerbatik
      @SpidermanBerbatik 5 ปีที่แล้ว

      @@AtifSayings by github and read official web for license

    • @AtifSayings
      @AtifSayings  5 ปีที่แล้ว

      @@SpidermanBerbatik yes i've seen after your previous reply
      use this library, no need to login/register at their site
      implementation 'com.itextpdf:itextg:5.5.10'
      BTW ill try making video on pdf from webview

  • @aryanbhaskar7872
    @aryanbhaskar7872 2 ปีที่แล้ว

    Bro itext is not converting hindi texts into pdf .... how to fix it

    • @AtifSayings
      @AtifSayings  2 ปีที่แล้ว +1

      Is it converting other languages like English?

    • @aryanbhaskar7872
      @aryanbhaskar7872 2 ปีที่แล้ว

      @@AtifSayings nope

  • @mr_cat6558
    @mr_cat6558 4 ปีที่แล้ว

    sir how if i want to change the view format ? pls help

  • @GuyLovesMakima
    @GuyLovesMakima 5 ปีที่แล้ว +1

    it always falls with "Permission denied" the "Allow access" alert doesn't shows up. Help please

  • @raimundojose3551
    @raimundojose3551 5 ปีที่แล้ว

    how to create doc files with java and androistudio

  • @pakgeochannel8419
    @pakgeochannel8419 3 ปีที่แล้ว

    Urdu ko save karne ke bad PDF file ko check karte hain to PDF file mea Urdu show Nahi Hotie

  • @ahmedshakr7802
    @ahmedshakr7802 3 ปีที่แล้ว

    I need write Arabic but not save any chart because language write arabic

  • @farukh403
    @farukh403 4 ปีที่แล้ว

    Thanks, can someone tell me how can i shard this created pdf file in android stuido like share to whatsapp and facebook

  • @StoryOfRitika
    @StoryOfRitika 4 ปีที่แล้ว

    how to show downloading progress bar in notification bar

  • @ragothamanvenkatasubramani5092
    @ragothamanvenkatasubramani5092 4 ปีที่แล้ว

    It is not storing in my physical storage

  • @adityaroy1851
    @adityaroy1851 4 ปีที่แล้ว +1

    sir make gallery application.

  • @WMPD39
    @WMPD39 5 ปีที่แล้ว

    how to change in pdf ??
    document.close()
    ------------ change -----------
    document.open()
    document..pageSize = RectangleReadOnly(360f, 360f)

  • @keithscull8288
    @keithscull8288 5 ปีที่แล้ว +2

    To OPEN the PDF file as soon as it's created, take the File object created in this video and create/call the below method:
    private void openPdfFile(File pdfFile) {
    if(Build.VERSION.SDK_INT>=24){
    try{
    //For API's > 24, runtime exception occurs when a URI is exposed BEYOND this particular app that you are writing (AKA when user attempts to open in device/emulator
    Method m = StrictMode.class.getMethod("disableDeathOnFileUriExposure");
    m.invoke(null);
    }catch(Exception e){
    e.printStackTrace();
    }
    }
    Intent target = new Intent(Intent.ACTION_VIEW);
    target.setDataAndType(Uri.fromFile(pdfFile),"application/pdf");
    target.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
    Intent intent = Intent.createChooser(target, "Open File");
    try {
    startActivity(intent);
    } catch (ActivityNotFoundException e) {
    // Instruct the user to install a PDF reader here, or something
    }
    }

  • @shafqatali3065
    @shafqatali3065 4 ปีที่แล้ว

    Sir pdf file is not opened..........

  • @gulshan6395
    @gulshan6395 5 ปีที่แล้ว

    Sir how can i download pdf from firebase please help me in this

  • @santhoshr6301
    @santhoshr6301 4 ปีที่แล้ว

    Sir , how to create word file in android studio

    • @AtifSayings
      @AtifSayings  4 ปีที่แล้ว

      You need to search for library because there's no native support available

  • @ByChris
    @ByChris 5 ปีที่แล้ว

    I can't create an object of Document class

  • @faizullah5961
    @faizullah5961 5 ปีที่แล้ว

    how to make app like photex

  • @viju_the_solution
    @viju_the_solution 4 ปีที่แล้ว

    Environment.getExternalStorageDirectory() is deprecated

    • @AtifSayings
      @AtifSayings  4 ปีที่แล้ว

      Depreciated doesn't mean it will not work

  • @rahhi9792
    @rahhi9792 5 ปีที่แล้ว

    How to add image in pdf file

  • @zakblacki
    @zakblacki 4 ปีที่แล้ว

    Does not work on latest androidx permission denied

    • @rookie0017
      @rookie0017 4 ปีที่แล้ว

      Did you found any way to do it? I'm desperate

    • @zakblacki
      @zakblacki 4 ปีที่แล้ว +1

      @@rookie0017 I asked on stack If I get answer I'll share

    • @rookie0017
      @rookie0017 4 ปีที่แล้ว

      @@zakblacki apreciate it

    • @zakblacki
      @zakblacki 4 ปีที่แล้ว +1

      @@rookie0017 stackoverflow.com/questions/59525503/permission-to-save-text-in-storage-android-not-working/59525794#59525794

  • @cricbuz4758
    @cricbuz4758 3 ปีที่แล้ว +1

    i got error sir

  • @aneesshaikh7789
    @aneesshaikh7789 3 ปีที่แล้ว

    App ka wattsap no chaiye

  • @nadiabrachemi3015
    @nadiabrachemi3015 4 ปีที่แล้ว +1

    very bad djob

  • @ViralU
    @ViralU 6 ปีที่แล้ว

    sir, google adsense ki pin pakistan m kitny dinoo tk deliver hoti h?

  • @Android-zh9pc
    @Android-zh9pc 4 ปีที่แล้ว +1

    thank you so much