Document Manager Tech Tips & Tricks

PDF Viewing

  • PDF.JS vs Iframe
  • Data URI vs URL
  • View Parameters
  • IE PDF iframe z-index
  • iOS PDF viewing

PDF Upload

  • HTTP Async read
  • Transaction Scope
  • Pages Count (Aspose)
  • IE Preview issue
  • Enterprise Library

HTTP Async

public postCachePdf(pdf:Blob) : HttpObservable<any> {
    return this.http.post("ScanDocument", "PostStoredPdf", pdf);
}
public async Task<JObject> PostStoredPdf(HttpRequestMessage request)
{
    var filesReadToProvider = await request.Content.ReadAsMultipartAsync();

    foreach (var stream in filesReadToProvider.Contents)
    {
        var fileBytes = await stream.ReadAsByteArrayAsync();

        ...
    }
}

Transaction Scope

[HttpPost]
[SkipTransactionScopeFilter]
public async Task<JObject> PostStoredPdf(HttpRequestMessage request)
{
    ...
}
// .NET 4.5.1 +
new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)

PDF Pages Count

public int GetPdfPageCount(byte[] aDocument)
{
    MemoryStream ms = new MemoryStream(aDocument);
    ms.Position = 0;

    Aspose.Pdf.Facades.PdfViewer viewer = new Aspose.Pdf.Facades.PdfViewer();
    viewer.BindPdf(ms);

    return viewer.PageCount;
}

TIFF

  • What is TIFF?
  • Compression
  • LZW - B&W
  • Reading
  • Saving

General

  • Flow
  • Browse
  • Zoom (scale)
  • Caman

Flow

Blob

createObjectURL

TIFF.js

Canvas

Iframe

Get PDF URL

Upload + Get temp URL

Browse

Load

PDF

Caman

PDF

Document Manager Tech Tips & Tricks

By risweb

Document Manager Tech Tips & Tricks

  • 520