Scaling and adding text to an existing document

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

pderuiter
User
Posts: 2
Joined: Thu Jan 31, 2013 7:37 am

Scaling and adding text to an existing document

Post by pderuiter »

I'm using the trial version with vb.net to get the following done:
I can rotate existing an pdf, that's no problem, but when i turned to scaling i ran into some trouble:
I want to get the page size, and i'm using pxcp_PageGetBox for that (pxc_getpage wasn't working, but i guess that's because pxc and pxcp functions can't be mixed)
as in the example i query the cropbox and if failed, the mediabox.
The mediabox returns a rectangle of 0 by 0.
- Am i doing something wrong? Is there another way to do this? I have no control over how the documents are generated.

The next question has to do with adding text to an existing pdf. I see some examples on how to add text to a new document, but i want to add it to my scaled / rotated document
I browsed the help file, but didn't find anything that seemed to match my needs.
- Did i miss something? Is there a way to copy the existing pdf into a new one (not preferred, but if there is no other way)
You do not have the required permissions to view the files attached to this post.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17949
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: Scaling and adding text to an existing document

Post by Tracker Supp-Stefan »

Hello pderuiter,

pxcp_PageGetBox should work for your document, so in order to be able to reproduce and test this we will need you to prepare and send us a sample project inclusive of test files and instructions how to use it to reproduce the problem.

As for adding text to an existing document - the best way would be to create a new document with the needed text save that and then use PXCp_PlaceContents to combine it with your existing document.

Best,
Stefan
pderuiter
User
Posts: 2
Joined: Thu Jan 31, 2013 7:37 am

Re: Scaling and adding text to an existing document

Post by pderuiter »

Attached is my project that i use. The document was attachted to my initial post.
In my project i had the dlls in the same directory as my .vb files, but i had to remove them to keep the zip file size down
You do not have the required permissions to view the files attached to this post.
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom

Re: Scaling and adding text to an existing document

Post by John - Tracker Supp »

Thanks,

This has been passed to a member of our development support team and we will come back as soon as possible.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
Nico - Tracker Supp
User
Posts: 205
Joined: Fri May 18, 2012 8:41 pm

Re: Scaling and adding text to an existing document

Post by Nico - Tracker Supp »

Hi pderuiter,

Thank you for your post.
PXCp_PageGetBox() does not return size of media box because the last argument needs to be passed by reference.
Proper declaration is: PXCp_PageGetBox(ByVal doc As Integer, ByVal index As Integer, ByVal pBoxID As PXC_PageBox, ByRef rect As PXC_RectF)
Please remember you should never mix PXC_ functions with PXCp functions as it is explained in the manual.
Thanks.

Sincerely,