Any way to find double current pages in turn.js? - turnjs

My requirement is to display the current double pages in following format:-
2-3
4-5
and I only done with displaying singe page at a time however there is a double page view.
like
2 at 2-3
4 at 4-5
Any idea how do I fetch these current double pages in expected format?
I know I can do it by using adding logic, but would be better if I do it with internal logic of turnjs.
because It can be happen only single page comes sometimes like cover page or last page. I am sure there must be a way to find by turnjs only.
Any help will be appreciated...
Thanks in Advance.

I found its solution.. There is an array with the name view that holds the page's numbers to display. If there is a page 1 it holds the value
view[0] =1
View [1]=0
Similarly if its a last page lets say page 12 then the value in view will be
View [0]=0
View [1]=12
And if we are at 4-5 pages then
View [0]=4
View [1]=5
Got the solution :)

To be more specific here you can use this property.
view
Eg.
var view = $("#flipbook").turn("view").join(" - ");
alert("Current view: "+view);
It will return like this.
0 - 1
2 - 3
.......
Read here: http://www.turnjs.com/docs/Property:_view

Related

iText7 How do I know Table flows to next page like ITextshap Column.HasMoretext?

I have a form where I have to place some fixed data on top and bottom with a variable table in between. If table does not fit on first page, there should be created more pages as needed to acomodate Table.
But for page 2, 3, 4... I still have to print top & bottom, but this time a short version of whats was placed on page 1.
In ItextSharp5 with ColumnText.HasMoreText = true, I know when a new page is needed and can make a new page with proper top & bottom data before drop remaining table.
So how can I achieve same behaviour with iText7?
I did not found a way to know when a table needs some more room
After some reading, found a starting point at Chapter 2: Adding content to a Canvas or a Document
on 3th block of code.

How To Position a Picture on A Second Page Of A Word Document VB6

I am making a program that repeatedly creates pages of an undefined quantity, and on the top of all the pages is a logo that is in a certain position. If I have everything in a for loop and at the end I include these commands to make a page break:
Set oRng = oDoc.Bookmarks("\EndOfDoc").Range
oRng.InsertBreak
The second time (and subsequent times) the table I make goes on the the next page, but the image does not. I have tried setting the "top" property to
distFromTop + pageLength * pageNumber.
I would assume it might have to do with the anchor property, but I have no idea what data type that even gets or how it affects the placement
I insert the image using:
oDoc.Shapes.AddPicture "C:\Users\name\Desktop\file.jpg", , , CentimetersToPoints(1.3), CentimetersToPoints(0.9 + pageLength * j), CentimetersToPoints(6.1), CentimetersToPoints(2.9)
The picture adds multiple times, but both to .9 from the top on the first page and 1.3 from the left, on the first page.
How can I make the pic go .9 from the top of a certain page
EDIT: I would like to avoid putting it in a header because that would mess up the alignment of the other elements of the doc
Ok, So what worked for me was this:
Set oRng = oDoc.Bookmarks("\EndOfDoc").Range
oRng.InsertBreak
oDoc.Shapes.AddPicture "C:\Users\me\Desktop\file.jpg", , , CentimetersToPoints(1.3),
CentimetersToPoints(0.9), CentimetersToPoints(6.1), CentimetersToPoints(2.9),
oDoc.Bookmarks("\EndOfDoc").Range
I still don't quite understand why it works, because the documentation for a range objects / anchors was fairly hard for me to understand... I tried this out and this worked. For my purposes that worked, but if anyone knows why that works I would love to know
Thanks for your answers

Issue regarding subreprt in active report 7

I want display records in the active reports 7 as 4 record in one page and information that record in the next page?So,I what should use do that?I have tried sub-report and page break but that doesn't work?
Is there any other way to use sub report or any other thing that we can use.
As far my understanding of the issue goes, you want to show 4 records on a page and then show the remaining data on the new page. There isn't any direct way to achieve this.
However a workaround for you is to make use of the If-else loop in the Detail's Format event. Add a counter in the Detail's Format event and when it reaches '4', set the NewPage property of Detail Section to 'After' under the 'If' condition and under the 'Else' part reset the NewPage property of Detail Section to 'None'. 
Please share your observations with us.
Regards,
Mohita

set the page size with UITableView and paging.enabled=YES (or other way ?)

I'm struggling with this problem, although I'm close to the solution, but I guessing I'm missing something.
Here is the situation :
I have UITableView with 30 cells, and one section header (if it's helpful..).
The table size is exactly the size of 3 rows.
The mission : to let the user scroll 3 rows everytime, exactly 3.
I set the pagingEnabled=YES.
What happens is :
"page 1" - 3 rows - ok (rows 0-2)
swiping to "page 2" - next 3 rows - ok (row 3-5)
swiping to "page 3" - and the paging is not good, either skiping row 6 and showing row 7-9
or the page is stopped in the middle of the cell of 6 (also tried to move the scroll to complete cell visibilty with scolling end event, but it skips some of the rows on some pages)
Any ideas how to fix the situation, every page = 3 rows only ,without skipping or showing half of cell ?
I don't mind if the way will be without pagingEnabled=YES.
I arrived at the conclusion this is basic thing I will use in the future , and I think a lot of others will use the solution that other friends will give here.
Thanks.
Never thought of using this property in a Table View.
Since it is a subclass of UIScrollView, try instead to use the UIScrollViewDelegate methods and calculate where to stop.
A good place to start can be in scrollViewWillEndDragging:withVelocity:targetContentOffset:. and return the offset yourself.
P.S.
from the documentation:
This method is not called when the value of the scroll view’s
pagingEnabled property is YES. Your application can change the value
of the targetContentOffset parameter to adjust where the scrollview
finishes its scrolling animation.

Erratic UIPageControls

I'm using two UIPageControls in a view to reflect chapters and pages. So I have defined one UIPageControl named chapterCount and one named pageCount just to show where the user is. I handle the flipping of the pages with swipes rather than using the UIPageControls (so no methods defined for them).
I change their values as the user change pages with the following code:
chapterCount.numberOfPages = chapters;
chapterCount.currentPage = chapterNumber;
pageCount.numberOfPages = pages;
pageCount.currentPage = pageNumber;
[chapterCount updateCurrentPageDisplay];
[pageCount updateCurrentPageDisplay];
Where chapters, chapterNumber, pages and pageNumber all are integers.
The first time I flip through the pages it normally works fine, but when I go to a previous chapter or start a new chapter, the first (or last depending on direction) dot is not showed. Please see picture (upper half is missing a dot, lower one OK).
alt text http://img80.imageshack.us/img80/3339/pagecontrol.png
Its the same code updating the controls and sometime I get a dot, sometimes not. When I check the variables with NSLOG they are correct (eg the same for both pictures above).
I have checked Apple's documentation and tried their example but no luck.
Where should I start troubleshooting? I'm getting crazy!!
I finally found the problem :-)
An UIPageControl that is given a value 0 for number of pages will not show correctly the next time it is updated. I was reading chapter and page numbers from an array and in the beginning (let's say cover of the book) there are no pages and no chapters to show, so I happily set these to 0. Since I did not want to change the source data in my array I used MAX(pages , 1) for numberOfPages, so now it's working like clockwork.
Are you sure your chapterCount and pageCount views are not nil? You can have valid values all day, a message to nil does nothing and returns nil. Double check your view and controller wiring/unwiring when you change chapters.
EDIT:
confirm the size of the control is big enough to hold all your pages, and the view bounds is not clipped. For example, if you had 10 pages, and the "current" page was 10, but there were only 9 dots visible, it would appear as though nothing is highlighted because the white dot would be clipped from the visible area by being outside the viewable bounds. You can adjust the size dynamically using this:
- (CGSize)sizeForNumberOfPages:(NSInteger)pageCount