Hello,
is there a possiblity to load a Bitmap/HBitmap into your viewer component?
As I read there are tree options for loading:
-by file
-by url
-by stream
So my question is if the viewer is only accepting pdf streams or bitmap too?
Thanks and best regards
Tobias Herold
EbbinghausTeam
Loading from Bitmap/HBitmap available?
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: Loading from Bitmap/HBitmap available?
Hello Tobias,
Yes loading from stream is for PDF streams only.
Have a look at section
2.2.1.29 NewDocumentFromImages
in the Viewer AX SDK manual however - for a way to create a new document from images.
Best,
Stefan
Yes loading from stream is for PDF streams only.
Have a look at section
2.2.1.29 NewDocumentFromImages
in the Viewer AX SDK manual however - for a way to create a new document from images.
Best,
Stefan
-
- User
- Posts: 17
- Joined: Fri May 27, 2011 7:20 am
Re: Loading from Bitmap/HBitmap available?
Thanks for the fast answer. This looks like exactly what I'm looking for.
In the pseudocode-sample the picturesource is directly from file. Is it also possible to load from stream or better hBitmap-pointer?
In the pseudocode-sample the picturesource is directly from file. Is it also possible to load from stream or better hBitmap-pointer?
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: Loading from Bitmap/HBitmap available?
Hello Tobias,
As you would be creating the PDF File from images anyway - it might be better to use the PDF Tools SDK, and then you can add images from HBITMAP directly ( PXC_AddImageFromHBITMAP ), and place them ( PXC_PlaceImage ) on pages inside the document you are creating. You will have better control over the PDF creation process, and you can then always visualize the result in the Viewer.
If you want to stick to using the Viewer SDK only - you will need to save those images to files first it seems.
Best,
Stefan
As you would be creating the PDF File from images anyway - it might be better to use the PDF Tools SDK, and then you can add images from HBITMAP directly ( PXC_AddImageFromHBITMAP ), and place them ( PXC_PlaceImage ) on pages inside the document you are creating. You will have better control over the PDF creation process, and you can then always visualize the result in the Viewer.
If you want to stick to using the Viewer SDK only - you will need to save those images to files first it seems.
Best,
Stefan
-
- User
- Posts: 17
- Joined: Fri May 27, 2011 7:20 am
Re: Loading from Bitmap/HBitmap available?
Okay, understood...almost.
Though what about the pdf document which is created by the pdf tools SDK...how can I add this one to your viewer control directly from memory? Or have I to store it to hdd at first?

Though what about the pdf document which is created by the pdf tools SDK...how can I add this one to your viewer control directly from memory? Or have I to store it to hdd at first?
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: Loading from Bitmap/HBitmap available?
Hi Tobias,
I do think you will need to save the generated PDF to file before you can pass it to the Viewer control if you do generate it with the PDF Tools SDK, but I will speak with one of our dev guys to see if they have any better ideas.
Best,
Stefan
I do think you will need to save the generated PDF to file before you can pass it to the Viewer control if you do generate it with the PDF Tools SDK, but I will speak with one of our dev guys to see if they have any better ideas.
Best,
Stefan
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: Loading from Bitmap/HBitmap available?
I stand corrected Tobias,
The guys just pointed me that you could use PXC_WriteDocumentToIStream + PXCV_ReadDocumentFromIStream to achieve what you want.
Best,
Stefan
The guys just pointed me that you could use PXC_WriteDocumentToIStream + PXCV_ReadDocumentFromIStream to achieve what you want.
Best,
Stefan
-
- User
- Posts: 17
- Joined: Fri May 27, 2011 7:20 am
Re: Loading from Bitmap/HBitmap available?
That's very kind of you, thank you.
Hope there's a possibility because using a temporary file might have perfomance issues and working within memory would be much better.
Hope there's a possibility because using a temporary file might have perfomance issues and working within memory would be much better.
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: Loading from Bitmap/HBitmap available?

Actually I just posted the solution a few seconds before you replied in my previous post.
Best,
Stefan
-
- User
- Posts: 17
- Joined: Fri May 27, 2011 7:20 am
Re: Loading from Bitmap/HBitmap available?
Good work - thanks for the fast and reliable support.
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am