View Poll Results: about this idea

Voters
2. You may not vote on this poll
  • nice

    0 0%
  • good

    0 0%
  • bad

    2 100.00%
Multiple Choice Poll.
Results 1 to 14 of 14

Thread: how can create a user control for show pdf inside or from path or resource or stream?

  1. #1

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Post how can create a user control for show pdf inside or from path or resource or stream?

    1-i need create a user control for show pdf inside of my user control without use any other ocx.
    and i want can use load pdf from resource (res) or stream like file binary or ... .
    any way ?


    2-any any way to can create pdf too with choose font(important) and choose utf page or unicode options.

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: how can create a user control for show pdf inside or from path or resource or str

    Why did you create this as a poll? It's a valid question, but not much of a poll.
    My usual boring signature: Nothing

  3. #3
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,056

    Re: how can create a user control for show pdf inside or from path or resource or str

    [...]
    Last edited by dz32; Apr 26th, 2019 at 11:25 AM.

  4. #4

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: how can create a user control for show pdf inside or from path or resource or str

    Quote Originally Posted by dz32 View Post
    writing your own control to display a pdf reliably without an external ocx is a substantial project all on its own. Pdfs support many different encoding formats and there are allot of nuances about how the headers are parsed. The formal spec is quite large and not well followed.

    800 page pdf spec:
    http://www.adobe.com/devnet/acrobat/...32000_2008.pdf



    Open source vb6 pdf stream parser/viewer (no rendering or generation)
    https://github.com/dzzie/pdfstreamdumper

    The only way this could be done reasonably small is if you made it to only display simple pdfs that you generate but you will have to understand allot of pdf internals. I think PSC has some vb6 code to generate simple pdfs ymwv as to how well it renders in different readers.

    When accounting for time I think the best option will be to find a premade ocx to generate/display pdf docs.

    i created this thread because i want dont use any ocx and so i am looking for sourc code for read or write pdf without ocx.
    i downloaded pdfstreamdumper but this is just hexa editor,how can see pdf on form ? and how can write pdf with utf 8 support?


    my problem not fixed yet,any have sample code like user control for display pdf without use acrobat reader componenets or like it?
    i want display pdf just use from my user control or i want created pdf file utf8 support.

  5. #5
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: how can create a user control for show pdf inside or from path or resource or str

    Did you actually read the answer of dz32??
    It's a tremendous job!

    Do you have a good reason not to use existing solutions?

  6. #6

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: how can create a user control for show pdf inside or from path or resource or str

    any sample code or sample user control for read pdf or write pdf (utf support) without other ocx like acropdf or office viewer or ... ?

  7. #7
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: how can create a user control for show pdf inside or from path or resource or str

    Quote Originally Posted by Black_Storm View Post
    any sample code or sample user control for read pdf or write pdf (utf support) without other ocx like acropdf or office viewer or ... ?
    As already stated by Arnoutdv - the pdf-spec is *enormous* (hundreds of "tags" with dozens of different parameter-options,
    many of these parameter-options again with dozens of different "sub-options" for differing compression-schemes and what not).

    1) A PDF-Writer (which translates incoming DrawingCommands +their Parameters to text-based "PDF-tag-outputs") is *much* easier to implement
    ..(because it only has to use a small subset of all the available "tags" and "options" which make up the pdf-spec)
    e.g. Cairo (and thus also the RC5) support pdf-writing in that way (translating all incoming cairo-drawing-comands into appropriately concatenated PDF-txt-stream-Snippets)

    2) On the other hand, a (decent!) PDF-Reader has to support *all* (or nearly all) of the possible options of the pdf-spec (which is heavily based on the PostScript-spec in turn).
    That's why PDF-Reader-Libraries tend to be that large.

    And no, there is currently no VB6-Sources for decent PDF-Reading, so you *will* have to ship a library of about 3-5MB alongside
    your own Binary, if you want to make yourself independent form "potentially not installed PDF-Readers" on a given customers system.

    I don't know what you are trying to build there in the end (what is it BTW?) - but it seems to be something "GUI-oriented and big".

    From my experience, you cannot build something "GUI-oriented with a whole lot of modern functionality",
    without relying on other peoples work (either in form of sources or in form of compiled libraries).

    The current practice seems to be:
    - to "hide other peoples sources, often without giving them credit" ... accompanied by
    - "if it's not possible to gain access to the sources, I will have to hide these dependency-dlls of other people
    .. in my own binary, and later drop them onto the users system, hopefully without them noticing).

    Well, the obvious (and decent) thing to do is, "to not hide the work of other people, which your solution was built upon" by:
    1) giving those other people (in case it was source-code) the credits they deserve in your "deployment-zip" or your "about-screen"
    2) shipping the libraries your solution depends on in an openly visible "\Bin\" or "\Dep\" of your deployment-zip (apply rules mentioned in #1 above, here in addition)

    Currently you do no such thing (and your *insistence* on "source-only-solutions", because of: "you know, reasons"... sounds a bit suspicious to me).

    In the last zipped-up Demo you've posted (for your recent 9-patch-png "solution"), I've not found any sources at all
    it was a "code-wise" empty VB-Project, which only referenced a roughly 1MB large OCX (with no source),
    which then handed out "just a few fancy rendered Buttons" - not more.

    The fact, that LaVolpes Alpha-Image-Project is doing the "heavy lifting" under the covers of your OCX was mentioned nowhere.
    (no written credits to his work in your Zip or VB-Project anywhere, and the UserControl- interface of the AlphaImage-Control was not exposed).

    I'd strongly suggest to change that current practice of yours in the "final" of your OCX which you ship to end-users.

    Olaf

  8. #8

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: how can create a user control for show pdf inside or from path or resource or str

    my language is not english so i hv problem with some descriptions,if u say possible read or write pdf with utf8 support with rc5 so send a sample source code and if u are doing say possible with dz32 post so say a sample code.thanks


    and about thread how-can-show-my-png-image-on-form-with-display-blur-effect-under-it-need-user-contro can u send a sample code to can show on desktop layer? i want show outside from form

  9. #9
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,056

    Re: how can create a user control for show pdf inside or from path or resource or str

    [...]
    Last edited by dz32; Apr 26th, 2019 at 11:25 AM.

  10. #10

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: how can create a user control for show pdf inside or from path or resource or str

    Quote Originally Posted by Schmidt View Post
    As already stated by Arnoutdv - the pdf-spec is *enormous* (hundreds of "tags" with dozens of different parameter-options,
    many of these parameter-options again with dozens of different "sub-options" for differing compression-schemes and what not).

    1) A PDF-Writer (which translates incoming DrawingCommands +their Parameters to text-based "PDF-tag-outputs") is *much* easier to implement
    ..(because it only has to use a small subset of all the available "tags" and "options" which make up the pdf-spec)
    e.g. Cairo (and thus also the RC5) support pdf-writing in that way (translating all incoming cairo-drawing-comands into appropriately concatenated PDF-txt-stream-Snippets)

    2) On the other hand, a (decent!) PDF-Reader has to support *all* (or nearly all) of the possible options of the pdf-spec (which is heavily based on the PostScript-spec in turn).
    That's why PDF-Reader-Libraries tend to be that large.

    And no, there is currently no VB6-Sources for decent PDF-Reading, so you *will* have to ship a library of about 3-5MB alongside
    your own Binary, if you want to make yourself independent form "potentially not installed PDF-Readers" on a given customers system.

    I don't know what you are trying to build there in the end (what is it BTW?) - but it seems to be something "GUI-oriented and big".

    From my experience, you cannot build something "GUI-oriented with a whole lot of modern functionality",
    without relying on other peoples work (either in form of sources or in form of compiled libraries).

    The current practice seems to be:
    - to "hide other peoples sources, often without giving them credit" ... accompanied by
    - "if it's not possible to gain access to the sources, I will have to hide these dependency-dlls of other people
    .. in my own binary, and later drop them onto the users system, hopefully without them noticing).

    Well, the obvious (and decent) thing to do is, "to not hide the work of other people, which your solution was built upon" by:
    1) giving those other people (in case it was source-code) the credits they deserve in your "deployment-zip" or your "about-screen"
    2) shipping the libraries your solution depends on in an openly visible "\Bin\" or "\Dep\" of your deployment-zip (apply rules mentioned in #1 above, here in addition)

    Currently you do no such thing (and your *insistence* on "source-only-solutions", because of: "you know, reasons"... sounds a bit suspicious to me).

    In the last zipped-up Demo you've posted (for your recent 9-patch-png "solution"), I've not found any sources at all
    it was a "code-wise" empty VB-Project, which only referenced a roughly 1MB large OCX (with no source),
    which then handed out "just a few fancy rendered Buttons" - not more.

    The fact, that LaVolpes Alpha-Image-Project is doing the "heavy lifting" under the covers of your OCX was mentioned nowhere.
    (no written credits to his work in your Zip or VB-Project anywhere, and the UserControl- interface of the AlphaImage-Control was not exposed).

    I'd strongly suggest to change that current practice of yours in the "final" of your OCX which you ship to end-users.

    Olaf
    if i should be use rc5 so can u send a sample code for read or write pdf (utf8 support)with rc5 ?

  11. #11
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    597

    Re: how can create a user control for show pdf inside or from path or resource or str

    Sir, you should use your own brain instead of begging helps. If it is beyond of your capability, don't force yourself.

  12. #12

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: how can create a user control for show pdf inside or from path or resource or str

    no way yet ?

  13. #13
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: how can create a user control for show pdf inside or from path or resource or str

    Ok, thought that you've searched the Forum for RC5 and PDF-Output already ...
    (BTW - you'll get better "hit-results", when you use the [Google Custom Search] field, located in the TopCenter of this Forum-Site).

    Here is a link to a CodeBank-article I've posted a while ago:
    http://www.vbforums.com/showthread.p...rawingRoutine)

    And I've just enhanced that little Demo with a short "Title-Output" (containing Unicode, read from an UTF8-File) - looking like that.



    The produced PDF (for what you see in the above PagePreview-ScreenShot + an extra LandScape-Page) can be downloaded here:
    http://vbRichClient.com/Downloads/PDFOutput.pdf

    If you have questions about the Demo in the CodeBank (in case it's doing "too much already"),
    just ask here (or in the CodeBank-thread) - and I will try to provide a simpler example, which does not output as much.

    Olaf

  14. #14

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: how can create a user control for show pdf inside or from path or resource or str

    1-when i click on show Pixel- Srf-Preview on the Form i can see just a simple drawing on dc,how can show more than 1 page with scroll bar or better idea ?

    2-how can read pdf too by cairo ? my means if i create a pdf (more than 1 page) or if i have been a pdf,can i read and show it with cairo on form?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width