Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Merge page contents

More
IP: 47.35.39.76 5 years 1 month ago #15592 by ashughes
Merge page contents was created by ashughes
Is it possible to merge the content of two pages? I'd like to be able to open two PDFs and copy the contents from a page in the first PDF to a page in the second PDF.

To be clear, I'm not talking about importing a page from one PDF to another. I already know how to do that. That could be the first step, then copy the contents of that page to another page in the PDF, then delete the imported page, if that's necessary.

The result should also include any resources such as embedded fonts that are related to the contents that are copied.

Thanks!
More
IP: 111.196.242.56 5 years 1 month ago #15595 by radaee
Replied by radaee on topic Merge page contents
dear user:
we not supply this feature.
because, some page of PDF file erase background on each page, that mean, previous page content will be erased.
and this feature can be instead of: 
1. create bitmap, and then erase background
2. render page 1 from document 1 on this bitmap.
3. render page 2 from document 2 on this bitmap.
More
IP: 111.196.242.56 5 years 4 weeks ago - 5 years 4 weeks ago #15596 by radaee
Replied by radaee on topic Merge page contents
dear user.
now we add a new method to Master Edition.
which can draw a Page from another Document on Page of destination Document.
we will publish after some test.

Classic Edition has no change.
Last edit: 5 years 4 weeks ago by support.
More
IP: 47.35.39.76 5 years 4 weeks ago #15599 by ashughes
Replied by ashughes on topic Merge page contents
Okay, thank you. Here's our use case, in case it's helpful:

We currently have a text tool which uses the current system font (including whatever fallback fonts the system uses based on the characters the user enters). We can use the Android APIs to write text to a PDF, which uses Canvas / Skia to write the text using the appropriate font for each character and embeds the font into the PDF. We'd then like to merge that PDF page with an existing PDF page. The result would be the existing PDF page with the text on top of the page content with the appropriate fonts embedded.

I hope that makes sense. Please let me know if any clarification is needed.
More
IP: 111.196.242.56 5 years 4 weeks ago - 5 years 4 weeks ago #15601 by radaee
Replied by radaee on topic Merge page contents
it sounds, you have no need to merge 2 PDF pages into 1 page.
our API can write texts directly into existing PDF file.

please reference sample codes: com.radaee.reader.PDFTextAct.NewPage();

you can open PDF file by Document.Open();
and then using Page.AddContent(PageContent) to write contents into existing page.
PageContent object works like a canvas.
and all coordinates are in PDF coordinate system.
Last edit: 5 years 4 weeks ago by radaee.
More
IP: 47.35.39.76 5 years 3 weeks ago #15602 by ashughes
Replied by ashughes on topic Merge page contents
I am aware of how to write text to a PDF page via Page.AddContent(PageContent). This is what we currently do (and have done for many years). However, this is insufficient for our use case.

As I mentioned, our text tool uses the current system font and the Canvas / Skia fallback font system. This means that each character could be a different font. One character might be Roboto while another is using Noto Sans CJK or DroidSansFallback, etc. Android does not provide an API to determine which font is used to render each text character glyph.

This is why we need to be able to use the  Android APIs  to write text to a PDF via Canvas / Skia, which will use the same fonts to render each character as the view system does while rendering to the screen. Then we can merge the contents of the PDF page onto an existing PDF page.

Please let me know if you need further clarification.
Time to create page: 0.420 seconds
Powered by Kunena Forum