Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么获取某一页的数据呢? #211

Closed
yicheng2022 opened this issue Jul 10, 2023 · 14 comments
Closed

怎么获取某一页的数据呢? #211

yicheng2022 opened this issue Jul 10, 2023 · 14 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@yicheng2022
Copy link

What problem does this feature solve?

怎么获取某一页的数据呢?

What does the proposed API look like?

获取某一页的数据

@Hufe921
Copy link
Owner

Hufe921 commented Jul 10, 2023

需求场景能描述一下吗

@yicheng2022
Copy link
Author

yicheng2022 commented Jul 11, 2023

比如这一页有表格,有文字,有图片。我想复制这一页的数据,直接粘贴到新的一页上面。

@Hufe921 Hufe921 added the enhancement New feature or request label Jul 11, 2023
@Hufe921
Copy link
Owner

Hufe921 commented Jul 12, 2023

@Hufe921 Hufe921 closed this as completed Jul 12, 2023
@yicheng2022
Copy link
Author

v0.9.38 获取某一页数据:https://hufe.club/canvas-editor-docs/guide/command-get.html#getvalue 追加元素:https://hufe.club/canvas-editor-docs/guide/command-execute.html#executeappendelementlist

老大,getValue里面传的pageNo是怎样获取呢?我在文档里面没有找到获取当前页码的方法。

@Hufe921
Copy link
Owner

Hufe921 commented Jul 13, 2023

当前光标所在的页码?

@yicheng2022
Copy link
Author

当前光标所在的页码?

是的

@Hufe921
Copy link
Owner

Hufe921 commented Jul 13, 2023

@yicheng2022
Copy link
Author

https://hufe.club/canvas-editor-docs/guide/command-get.html#getrangecontext

这个是哪个版本的功能呢?我在0.9.38的代码里面没有找到这个方法。

@Hufe921
Copy link
Owner

Hufe921 commented Jul 14, 2023

v0.9.39

@yicheng2022
Copy link
Author

v0.9.39

刚刚拉最新的版本测试了一下,感谢大佬!
不过发现一个小问题,就是如果最后一页内容很少(只有半页或者几行字),他是直接在最后一页的内容后面增加内容了,没有新建一个空白页,再把内容给放到新页里面去。

@Hufe921
Copy link
Owner

Hufe921 commented Jul 15, 2023

直接在新页面追加元素,可以使用换页符

instance.command.executeAppendElementList([{
    type: ElementType.PAGE_BREAK,
    value: ''
  }, ........])

@yicheng2022
Copy link
Author

直接在新页面追加元素,可以使用换页符

instance.command.executeAppendElementList([{
    type: ElementType.PAGE_BREAK,
    value: ''
  }, ........])

好的,我试试,感谢!

@yicheng2022
Copy link
Author

直接在新页面追加元素,可以使用换页符

instance.command.executeAppendElementList([{
    type: ElementType.PAGE_BREAK,
    value: ''
  }, ........])

image
分页符打印的时候怎么去掉呢?设置了颜色为白色好像也没有起作用。

@Hufe921
Copy link
Owner

Hufe921 commented Jul 16, 2023

使用清洁模式https://hufe.club/canvas-editor-docs/guide/option.html EditorMode.CLEAN

@Hufe921 Hufe921 added the question Further information is requested label Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants