Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF

TOPIC:

HTTP Streaming 9 years 9 months ago #6607

  • rhill
  • rhill's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 21
  • Thank you received: 0
Hi guys, this is basically almost identical to what I am doing already, just to prevent any delays in waiting for the HEAD request to return with the actual file length.

But as mentioned, this is not the issue. The issue is that the Document_OpenStream method ends up calling out to the PDFHTTPStream download_blocks method repeatedly until the entire PDF file is downloaded but it does this in a synchronous manner and hence the PDF is not shown until it is fully downloaded.

We need to know if this is the intended behaviour because it seems wrong. The assumption we made was that the PDF file would start to download, the PDF file would be shown to the user, and as they scrolled through it, more data would be downloaded.

Is there an additional dependency on the PDF file being linearised (optimised for web view)? Even if this is the case, the code in PDFHTTPStream won't work without blocking the UI because it's using synchronous calls, and the code in Document_OpenStream seems to call out until all blocks are downloaded, rather than on demand as the user scrolls.

Please can you look into what happens in Document_OpenStream and test this out at your end to see if you get the remote PDF opening immediately and then being downloaded in chunks as the user scrolls?

Please Log in or Create an account to join the conversation.

HTTP Streaming 9 years 9 months ago #6608

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
for linearized PDF:
it is reading all page objects from linearzed table, to saving page information like page size, in core library, when open PDF file. but not include images and other objects.

Please Log in or Create an account to join the conversation.

HTTP Streaming 9 years 9 months ago #6610

  • rhill
  • rhill's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 21
  • Thank you received: 0
Hi there, thanks for the additional information on the linearised PDF.

Can you look into the main question though: related to the Document_OpenStream method ends up calling out to the PDFHTTPStream download_blocks method repeatedly until the entire PDF file is downloaded but it does this in a synchronous manner and hence the PDF is not shown until it is fully downloaded.

We need to know if this is the intended behaviour because it seems wrong. The assumption we made was that the PDF file would start to download, the PDF file would be shown to the user, and as they scrolled through it, more data would be downloaded.

Please Log in or Create an account to join the conversation.

HTTP Streaming 9 years 9 months ago #6611

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
as i explaned: library just read page objects.
for some heavy PDF file(like has huge images), it not download all PDF file, it just download blocks that contain page objects.
the images download only when the image need to be rendered.

PDFHttpStream: it download blocks that needed, others are write all with byte 0, and record all blocks as flag array.

Please Log in or Create an account to join the conversation.

HTTP Streaming 9 years 9 months ago #6612

  • rhill
  • rhill's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 21
  • Thank you received: 0
Yes, but that's not what I am seeing. Document_OpenStream makes repeated calls to PDFHTTPStream download_blocks at the point the PDF is displayed. It doesn't just download the first few blocks it continues until it has downloaded the entire file.

Please Log in or Create an account to join the conversation.

HTTP Streaming 9 years 9 months ago #6622

  • stronglee
  • stronglee's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 93
  • Thank you received: 2
Hi,rhill
I tried some httpStream files, and found something.
Did your PDF file website support resume broken downloads and Range properties?

such like this [urlRequest setValue:hval forHTTPHeaderField:@"Range"];

I tried some httpstream not support Range properties, that will cause download hole file.

#define testUrlPath @"www.radaee.com/files/test.pdf"
Could you use this website and have a try?

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum