Convert Image bitmap to PDF document in Android Studio PART 2

Поділитися
Вставка
  • Опубліковано 10 лис 2024

КОМЕНТАРІ • 37

  • @real33479
    @real33479 3 роки тому

    Brother, thank you for the explanation
    I did everything, but when I reduce the size of the image it loses clarity and becomes blurry
    Is there a way to clarify the picture?

  • @idelvertyondouii5787
    @idelvertyondouii5787 Рік тому +1

    can you convert pdfdocument to bitmap.?

  • @YADA70073
    @YADA70073 6 років тому +1

    Thank you very much for you help... from Part1 and Part2.

  • @timothyhu5991
    @timothyhu5991 6 років тому +3

    Hi I followed your code and I got this error attempt to invoke virtual method 'int android.graphics.bitmap.getwidth()' on a null object reference, is there any way to solve it ? Thank you.

    • @AndroidWithHaroon
      @AndroidWithHaroon  6 років тому

      Check if u have initialized bitmap or not

    • @timothyhu5991
      @timothyhu5991 6 років тому +1

      Programming Experts Yes I follow exactly your code but it crashed when I select a photo from gallery.

    • @umerblouch3922
      @umerblouch3922 6 років тому

      same error i faced

    • @Emirhan13178
      @Emirhan13178 5 років тому

      Same error

  • @TECHNOLOGYGEAR
    @TECHNOLOGYGEAR 6 років тому +2

    Assalamualaikum,
    Please help me to reduce file size and dimensions of the file.
    Because when i create pdf of large image then the pdf make approx 10-12mb as image.
    So please help me

  • @coolguy9236
    @coolguy9236 4 роки тому +1

    My image is getting rotated in the pdf! How would I solve it??

  • @reubenkurian1155
    @reubenkurian1155 4 роки тому +1

    the next pdf i make is overwriting ...how can i make separate pdf files

    • @AndroidWithHaroon
      @AndroidWithHaroon  4 роки тому

      Use different name of the pdf file.

    • @reubenkurian1155
      @reubenkurian1155 4 роки тому

      @@AndroidWithHaroon everytime i convert i will have to change the name f
      rom the code na then ?

    • @debopamroy853
      @debopamroy853 4 роки тому

      @@reubenkurian1155 you can keep the pdf name as of a variable name....and make sure the variable gets incremented everytime the program executes

    • @reubenkurian1155
      @reubenkurian1155 4 роки тому

      @@debopamroy853 done buddy ..thanks

    • @debopamroy853
      @debopamroy853 4 роки тому

      @@reubenkurian1155 welcome

  • @muhammadarsalan9684
    @muhammadarsalan9684 4 роки тому +2

    Bro please tell me to how convert multiple pictures into .pdf file ?

  • @darshanshirwale7904
    @darshanshirwale7904 4 роки тому +2

    Sir when i select image that app got crash plz give me solution plz plz plz

    • @juniiikhan405
      @juniiikhan405 4 роки тому +2

      try this for gallery image
      public void gotogallery(View view) {
      chooseImage();
      }
      public void chooseImage() {// choose image from gallery
      Intent intent = new Intent();
      intent.setType("image/*");
      intent.setAction(Intent.ACTION_GET_CONTENT);
      startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE_REQUEST); //activity result method call
      }
      @Override
      protected void onActivityResult(int requestcode,int resultcode,Intent data ) {
      super.onActivityResult(requestcode, resultcode, data);
      if (requestcode == PICK_IMAGE_REQUEST && resultcode == RESULT_OK && data != null && data.getData() != null) {
      Uri uri = data.getData();
      try {
      Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), uri);
      slectimageview=findViewById(R.id.imageviewimagetopdf_id);
      slectimageview.setImageBitmap(bitmap);
      } catch (IOException e) {
      e.printStackTrace();
      }
      }
      }

  • @ajinkyayerlekar2618
    @ajinkyayerlekar2618 5 років тому

    thanks for the nice video. How to make pdf to image ?

  • @ravilakhatariya8662
    @ravilakhatariya8662 3 роки тому +1

    code is not working jese galary me pic choose karte hai baaar nikal jate hai

  • @nwcoder
    @nwcoder 2 роки тому +1

    Sir please provide me source code link..

  • @sakar276
    @sakar276 6 років тому +2

    I want to show this pdf in my app how can I do that?

  • @reubenkurian1155
    @reubenkurian1155 4 роки тому

    buddy this is not working on android 10
    can anyone help?

  • @umerblouch3922
    @umerblouch3922 6 років тому +2

    my app crashed when i choose the picture from gallery

    • @ZeeshanAli-dk9wd
      @ZeeshanAli-dk9wd 5 років тому

      im also facing this

    • @altokecali301
      @altokecali301 5 років тому +1

      @@ZeeshanAli-dk9wd
      The error is because you do not have the permission declared in the code to choose the photo
      one solution is
      go settings
      Applications
      search your app
      storage and give permission

    • @juniiikhan405
      @juniiikhan405 4 роки тому

      try this for gallery
      public void gotogallery(View view) {
      chooseImage();
      }
      public void chooseImage() {// choose image from gallery
      Intent intent = new Intent();
      intent.setType("image/*");
      intent.setAction(Intent.ACTION_GET_CONTENT);
      startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE_REQUEST); //activity result method call
      }
      @Override
      protected void onActivityResult(int requestcode,int resultcode,Intent data ) {
      super.onActivityResult(requestcode, resultcode, data);
      if (requestcode == PICK_IMAGE_REQUEST && resultcode == RESULT_OK && data != null && data.getData() != null) {
      Uri uri = data.getData();
      try {
      Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), uri);
      slectimageview=findViewById(R.id.imageviewimagetopdf_id);
      slectimageview.setImageBitmap(bitmap);
      } catch (IOException e) {
      e.printStackTrace();
      }
      }
      }

  • @dipeshpatel133
    @dipeshpatel133 5 років тому

    bro i am having a problem the pdf file is not created neither the image was inserted in this app and there is no error in android studio
    please kindly solve my this error

    • @altokecali301
      @altokecali301 5 років тому

      The error is because you do not have the permission declared in the code to choose the photo
      one solution is
      go settings
      Applications
      search your app
      storage and give permission