0

Below is my code in xhtml to embed the PDF portfolio:

    <h:panelGroup layout="block">
                    <object id="pdfViewer" type="application/pdf"
                        data="#{sessionScope.showPortfolioURL}" height="700px"
                        width="100%"> </object>
                </h:panelGroup>

Could anybody please let me know how to print the PDF portfolio using javascript or jQuery or ajax on button click? I have the Print option over my embedded PDF but I am not able to use it since I have requirement to mark the entry in database once someone tried to print it. So I will have to make a back-end call from the same JS function. If you know anyway through primefaces then it would be great but I think there is none.

If there is any way I can call embedded Adobe Portfolio's default Print functionality from my application through Javascript or something then that would also do for me.


First off, the C standard says nothing about stacks and heaps. Those are implementation details of a given compiler. That being said, most compilers for desktop applications use both of these.

You are correct that pa is local to the main function and therefore resides on the stack. *pa however is not a local variable. It is an expression which evaluates to an instance of struct A.

In this case, the malloc function returns a pointer to a block of memory big enough for a struct A and the value of that pointer is stored in pa.

Generally speaking, anything returned by malloc, realloc, or calloc lives in the heap, while variables declared local to a function (even pointer variables which may point to the heap) reside on the stack.

4

2 回答 2

0

解决方案可能是使用 3rd-party pdf 库作为查看器并拦截打印功能以预先完成您自己的工作。例如,您可以使用 Mozilla 的pdf.js

于 2017-01-27T23:32:42.540 回答
0

如果您尝试从不了解实际内容的应用程序打印 PDF 包,通常意味着除 Acrobat 或 Adob​​e Reader 之外的任何内容,您可能只会获得作为基础 PDF 的封面页,该页是附件项目所附的基础 PDF至。

您需要做的是使用该库将 Portfolio 拆分为单独的 PDF 文件并打印出来。在这些情况下,大多数可以打印的库都能够处理单独的 PDF。请注意,投资组合中的所有项目都不一定是 PDF,它们可以是任何东西。

于 2017-01-27T23:54:38.107 回答