Add a Bitmap from mémory in existing PDF

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
SerLoi
User
Posts: 3
Joined: Tue May 24, 2016 3:51 pm

Add a Bitmap from mémory in existing PDF

Post by SerLoi »

Hello

I'm using Delphi. My goal is to add an image to an existing document.
My image is store in a bitmap in memory at the moment.

I open my document with PXCp_ReadDocumentW.
So I can't use PXC_AddImageFromHBITMAP (I tried and I have an access violation), normal, isn't it ?

On an other way, I use PXCp_AddWatermark, and it works perfectly :)
So the idea is to use PXCp_AddWatermark to print an image to my doc, but this function only loads
a bitmap from disk, not from memory... not very performant i I have to write my bitmap on disk just to be read by this function....

Maybe I'm totally in the wrong way.

What's the better solution to add an image (I have a HBitmap) to my existing PDF ?

Thank you !
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17822
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Add a Bitmap from mémory in existing PDF

Post by Tracker Supp-Stefan »

Hello SerLoi,

Our Tools SDK is now no longer actively developed as it has been replaced by the Core API.
Using the Core API it is really easy to do what you want:
https://sdkhelp.pdf-xchange.com/vie ... FromMemory

And in the Tools SDK as you have seen - you can't mix PXCp_ and PXC_ methods (the first are for modifying existing files, the second - for creating new pages/documents).

So is switching from Tools SDK to Core API a viable thing you can consider?

Regards,
Stefan
SerLoi
User
Posts: 3
Joined: Tue May 24, 2016 3:51 pm

Re: Add a Bitmap from mémory in existing PDF

Post by SerLoi »

Thank you for your very fast response.

I think your solution is the best solution.
But unfortunatly I have no time to switch and update my code right now :( ...

And I see you changed the system of licence too, I have to understand all the part or your system first what dll I need and so on :|


So actually, without update, the only way is to write on disk and use watermark ?

Thank you Stefan
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17822
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Add a Bitmap from mémory in existing PDF

Post by Tracker Supp-Stefan »

Hello SerLoi,

Just spoke with the lead developer for PDF Tools, and he said that with the Tools SDK, you can either use Watermarks as you have discovered or use Overlay (PXCp_PlaceContents). The second way gives you much more options but both will require saving to disk unfortunately.

Regards,
Stefan
SerLoi
User
Posts: 3
Joined: Tue May 24, 2016 3:51 pm

Re: Add a Bitmap from mémory in existing PDF

Post by SerLoi »

Hello Stefan

Ok Thank you for your response. I will use this for the moment and I will take a look
with the module 'CORE API'.

Since I use your product in these 3 ways:
- ActiveX integrated in my soft, and printing pdf without show the window
- Virtual Printer
- Tools to merge, create, modify PDF
with auto-install module if needed (for the client), It's not very simple to change and replace to a new module!

Kind regards
Serge
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17822
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Add a Bitmap from mémory in existing PDF

Post by Tracker Supp-Stefan »

Hi Serge,

The Core API will replace just the Tools SDK component in your product, so you can keep the Viewer AX and Virtual printer components intact.

Regards,
Stefan
Post Reply