IPXC_Page.PlaceContent (IIXC_Page) - image exists but not added to the page  SOLVED

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

IPXC_Page.PlaceContent (IIXC_Page) - image exists but not added to the page

Post by zarkogajic »

Hi Support,

I've been using the SavePageRectAsAnImage method from this post https://forum.pdf-xchange.com/viewtopic.php?f=66&t=30710&p=122842&hilit=Page_CreateEmpty#p122842.

As a result: I can save a page as an image - works as expected.

Now, what I really need is to place an image as a content into a pxc page.

Here's some pseudo code:

Code: Select all

  //cDoc is a Core Document having 1 page
  
  cDoc.Pages.Get_Item(0, page);
  page.Get_Box(PBox_MediaBox, stMediaBox);

  ... here comes the part with saving this page as an image, that is xcPage = DrawToIXCPage(...) ...

  //now trying to place that image of the first page onto a new page

  pImage := cDoc.AddImageFromIXCPage(xcPage, 0);

  cDoc.Pages.AddEmptyPages(1, 1, stMediaBox, nil, pUndoData);

  cDoc.Pages.Get_Item(1, newPage);

  cc := cDoc.CreateContentCreator;
  cc.PlaceImage(pImage);
  cc.Detach(pContent);

  newPage.PlaceContent(pContent, PlaceContent_After);

  cDoc.WriteToFile(...);
As a result, a new page is added at index 1, but it is empty - the pImage (xcPage) is not added to it.

What am I missing ?

p.s.
Hresults are all "ok"

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: IPXC_Page.PlaceContent (IIXC_Page) - image exists but not added to the page

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

This should help:
https://github.com/tracker-software/PDF ... Content.cs

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: IPXC_Page.PlaceContent (IIXC_Page) - image exists but not added to the page  SOLVED

Post by zarkogajic »

Hi Alex,

Thanks. Yes, I'm looking there.

Actually, I had an error in my code, sorry :)

-žarko
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17765
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: IPXC_Page.PlaceContent (IIXC_Page) - image exists but not added to the page

Post by Tracker Supp-Stefan »

Hello zarkogajic,

So all is good now once you found and fixed the error in the code? Can we consider this topic resolved?

Kind regards,
Stefan
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: IPXC_Page.PlaceContent (IIXC_Page) - image exists but not added to the page

Post by zarkogajic »

Hi Stefan,

Yes :)

p.s.
Already marked the topic as "solved"

Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

IPXC_Page.PlaceContent (IIXC_Page) - image exists but not added to the page

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply