Giter Site home page Giter Site logo

Comments (11)

HendrixString avatar HendrixString commented on August 15, 2024

Hi.

Using scroll view is not a good strategy
because it is clipped against itself.
Simply don't use one.
This library does not support continuous
rendering. Sorry.

Simply get everything outside.

from android-pdfmyxml.

sparkOverfl0w avatar sparkOverfl0w commented on August 15, 2024

So you are saying there is no way by which i can render the rest part in another page of the pdf? :(

from android-pdfmyxml.

HendrixString avatar HendrixString commented on August 15, 2024

You cannot with scrollView.

from android-pdfmyxml.

sparkOverfl0w avatar sparkOverfl0w commented on August 15, 2024

Okay then , please suggest any other way :(

from android-pdfmyxml.

HendrixString avatar HendrixString commented on August 15, 2024

move the content of the Srollview outside and divide it into pages, that's it,
the dimensions have to be static

from android-pdfmyxml.

sparkOverfl0w avatar sparkOverfl0w commented on August 15, 2024

one final question , if i dont use any scrollview how i can be able to show the stuff in my app which does not fit in the display, Actually im developing an app to make Resume , So i dont want to fit all the details in the display as it will look terribly small,So in order to see the whole stuff user have to scroll down to see,

from android-pdfmyxml.

sparkOverfl0w avatar sparkOverfl0w commented on August 15, 2024

https://i.imgur.com/HhlrEvI_d.jpg?maxwidth=640&shape=thumb&fidelity=medium

please see this , i want to get the stuffs like this in my pdf ,

from android-pdfmyxml.

HendrixString avatar HendrixString commented on August 15, 2024

The API of this library supports multi pages.
You need design each page. Or to break your
Long content into pages. The way most do it,
is to break the pages into seperate template views.
Another option might be using a scrollView and taking snapshots, and scrolling the view and then taking another snapshot etc...
I think this is possible by using the scrollTo() API of a scrollView.

Another option is to make template containers.
And to calculate how many of them you would need and then to add them dynamically

from android-pdfmyxml.

HendrixString avatar HendrixString commented on August 15, 2024

something like the code below, and then your templates/pages
are just ImageViews, that you feed them the images

@Override
    public final Bitmap render(Bitmap bitmap, int width, int height, in page_index, ScrollView view) {
        int specWidth   = View.MeasureSpec.makeMeasureSpec(width,  width==0   ? View.MeasureSpec.UNSPECIFIED : View.MeasureSpec.EXACTLY);
        int specHeight  = View.MeasureSpec.makeMeasureSpec(height, height==0  ? View.MeasureSpec.UNSPECIFIED : View.MeasureSpec.EXACTLY);

        view.measure(specWidth, specHeight);

        view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());

        // recycle bitmap
        Bitmap b        = bitmap;//Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);

        Canvas c        = new Canvas(b);
       
        //// here scroll
        view.scrollTo(0, PIXELS_PER_PAGE * page_index);

        view.draw(c);

        return  b;
    }

from android-pdfmyxml.

sparkOverfl0w avatar sparkOverfl0w commented on August 15, 2024

okay thanks dude , will try this.out ,

from android-pdfmyxml.

developerfromjokela avatar developerfromjokela commented on August 15, 2024

This functionality should be out of the box, not as separate. Now this library is pretty useless...

from android-pdfmyxml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.